Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Decrypt encrypted password

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2012-09-26 : 02:33:34
Dears,

I have created a asp.net user through asp.net membership form. Here my question that after I crated this user then password stored as in encrypted text. I need to write a sql query to decryption the password to be a readable password.

Below is my code but it give null value for the decrypted password field


select u.UserName as UserName, u.UserId UsID, m.Email as Email, m.Password as pwd,
convert(varchar(10), decryptbykey(m.Password, 1, convert(varchar(100), m.UserId))) as pwd
from aspnet_Membership m, aspnet_Users u where u.UserId = m.UserId


Regards
Shaji

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2012-09-26 : 03:15:24
How you encrypted your Password? if you use your .net code for Encryption, you have to do the Decryption on the same way.

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page
   

- Advertisement -