Tuesday, February 17, 2009

Openhack 2009 - Readact Mail

Last weekend I participated in Openhackday hosted by Yahoo! @ Taj residency and developed an application based on Redaction which won Best Confidential Messages award(an Ipod-touch :)).

The experience of coding continuously for 24 hr, Dance show, Bean bags all over the place, Delicious food, Redbull, Unlimited beer ;) all were good. Apart from fun part, I did learn many new things like YUI, OpenMail, JavaScript debugging, etc..

Also some unforgettable moments like working on YUI with help of Chris Heilmann ;)

What I did?

I developed a small mail application which can be integrated in to yahoo mail using Yahoo's openmail APIs.Instead of encrypting the whole mail, this application allows user to select a particular word that should be encrypted using a user's key and at receiving end other user can view those words only by providing same key.

Example use case
A Manager wants his mail to be formatted by his secretary but doesn’t want her to see all the sensitive data in that mail.

A 3 min demo on what I did is available @ http://www.youtube.com/watch?v=4DMT_fN66oI

Event wiki & winners list: http://openhack2009.pbwiki.com/
Other applications that were demoed : http://developer.yahoo.com/openhack/show/2009/feb/openhackindia/
Some pics from event : http://www.flickr.com/search/?q=hackdayindia&d=taken-20090213-&ss=0&ct=0&w=all

Wednesday, April 9, 2008

Byte Ordering between java and C#

In many scenarios, there will be a server which is written in one language(c# or java) and there will be a client written in another language(c# or java). The client-server communication may be carried out via binary-stream requests and responses. In my case the server was java and i had 2 clients one in java and another in c#. When i constructed a binary request and from java client and sent to server, i got a proper response. But when i sent the same request from c# client, i got an internal server error. I was stuck for a day, then only i figured out very basic mistake of mine. By default c# handles data in little-endian format and java operates on big-endian format. When i sent request from c# client, it was in little-endian format but java server assumed it as big-endian format and while decoding from binary format, it gets invalid data, bcoz of that it was throwing internal server error. once i convert the request stream in to big-endian format manually, everything started working as expected. So when ever we want to make a binary communication between server and client of different languages we need to take care of the endianess .

Tuesday, October 9, 2007

How to enable Log4net in IIS6.0 , Windows 2003

By default IIS 6.0 does not allow log4net to write logs to file. To enable this some permissions settings has to be changed.

The following steps will do that.

1. Select the virtual directory or website in IIS to which you want enable logs.

2. Select the permissions for that application and add IIS_WPG and give write permission to this account.

3. Go to LocalUsers and groups snap in using mmc command in window and add the current windows-login user to IIS_WPG group.

Now log4net should work fine :)

Saturday, August 11, 2007

Authentication mechanisms in ASP.Net

ASP.Net Generally supports 3 types of authentication mechanisms.
1.Windows authentication
2.Form authentication
3.Passport authentication

Out of above 3 mechanisms, commonly used 2 methods are windows and form.

Enabling this mechanisms are simple.
Open your application's web.config file and add tag and specify the mode.
learn more about authentication mechanisms

Now in form authentication you may need to use your Activedirectory or DataBase for authentication.
2 ways to do that.

1. Writing your own code to query your database or Activedirectory.
(in this case if u want to change your DB or AD you need to edit your code and recompile.)

here is a method to change your DB or AD with out editing code.

2. This can be done using Membership in .net by
adding tag to your web.config file.
learn more about membership

here i have given you very top level view. You may face problems in implementation. Write to me if you need any help.