Encrypting a password
-
hi everybody!! iam using the create user wizard and login control provided in the Login tab of the toolbox in VS2005. iam using them for authentication in my application. the problem is, i need to know how the password is encrypted and stored in the aspnetdb database when a new user is created. Also i need to know how the Login control authenticates a user, i.e., how does it verify the password entered while authenticating. i would be grateful to anybody who can help me in this regard as my entire application depends on this. The reason why i want to know this is i need to encrypt a password using the same method and verify it with the encrypted password in the aspnetdb. This would give correct results only if both methods of encrypting are same. thanks in advance to anybody and everybody who replies to this query. plz help me guys!!!!!!!
Sonu
-
hi everybody!! iam using the create user wizard and login control provided in the Login tab of the toolbox in VS2005. iam using them for authentication in my application. the problem is, i need to know how the password is encrypted and stored in the aspnetdb database when a new user is created. Also i need to know how the Login control authenticates a user, i.e., how does it verify the password entered while authenticating. i would be grateful to anybody who can help me in this regard as my entire application depends on this. The reason why i want to know this is i need to encrypt a password using the same method and verify it with the encrypted password in the aspnetdb. This would give correct results only if both methods of encrypting are same. thanks in advance to anybody and everybody who replies to this query. plz help me guys!!!!!!!
Sonu
Hi Sonu You need symmetric algorithm for functionality like encrypting password. In symmetric approach single key is used for encrypting strings. You can visit my blog http://aamironline.blogspot.com/2006/08/simple-encryption-and-decryption-with.html[^] where I have created a Cypher class for such purpose. If you are using login control for authentication then you will have to subscribe to Authenticate event of the control. Following sample code shows you how to do authentication with login authenticate event.
protected void Login_Authenticate(object sender, AuthenticateEventArgs e) { if (Login.UserName == "Aamir") e.Authenticated = true; else e.Authenticated = false; }
M Aamir Maniar aamirOnline.com