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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Decrypt encrypted password
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

179 Posts

Posted - 09/26/2012 :  02:33:34  Show Profile  Reply with Quote

I have created a user through 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


Flowing Fount of Yak Knowledge

1007 Posts

Posted - 09/26/2012 :  03:15:24  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000