HOW TO DECRYPT A PASSWORD

Posted by Parthibansk under Sql Server on 1/7/2013 | Points: 10 | Views : 1617 | Status : [Member] | Replies : 2
I HAVE ENCRYPTED USERS PASSWORD ON REGISTRATION USING ENCODING ALGORITHM..

ON PASSWORD RECOVERY I WANT 2 SENT THEM FORGOT PASSWORD..

HOW TO DECRYPT THE PASSWORD STORED IN DATABASE..




Responses

Posted by: .Netlearner on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
private string Encryptdata(string password)

{
string strmsg = string.Empty;
byte[] encode = new byte[password.Length];
encode = Encoding.UTF8.GetBytes(password);
strmsg = Convert.ToBase64String(encode);
return strmsg;
}

private string Decryptdata(string encryptpwd)
{
string decryptpwd = string.Empty;
UTF8Encoding encodepwd = new UTF8Encoding();
Decoder Decode = encodepwd.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(encryptpwd);
int charCount = Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
decryptpwd = new String(decoded_char);
return decryptpwd;
}


use these two functions for encryption and decryption.It works well.Hope This is useful for u.Mark this as answer if works.

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: .Netlearner on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
U want to select the encrypted password from the database and pass that password to decryptdata function

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response