Hie... in previous post i just did my password must to save in encrypt format while saving... as now if the user forgot password now i'm getting that password back with help of Email with decrypting as for that :
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] password = Convert.FromBase64String(retriew.pwd);
int charCount = utf8Decode.GetCharCount(password, 0, password.Length);
char[] decoded_password = new char[charCount];
utf8Decode.GetChars(password, 0, password.Length, decoded_password, 0);
string result = new String(decoded_password);
In above my encryted string is retriew.pwd..
Here now my password that decrypted one is now in my result string. now you can show to user where you want.
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] password = Convert.FromBase64String(retriew.pwd);
int charCount = utf8Decode.GetCharCount(password, 0, password.Length);
char[] decoded_password = new char[charCount];
utf8Decode.GetChars(password, 0, password.Length, decoded_password, 0);
string result = new String(decoded_password);
In above my encryted string is retriew.pwd..
Here now my password that decrypted one is now in my result string. now you can show to user where you want.
No comments:
Post a Comment