Encryption & Decryption
c#, encryption, sha1
Solution
Because that's what `ToString()` returns from an array of chars...
try
new string(new ASCIIEncoding().GetChars(bytehash));
and choose Maurice's answer, which is smarter ;)
Problem
I want to have a Encryption using SHA1. My Code is ``` public static string EncryptPassword(string password) { try { SHA1 sha1 = new SHA1Managed(); var bytehash = sha1.ComputeHash(new MemoryStream(new ASCIIEncoding().GetBytes(password))); var stringhash = new ASCIIEncoding().GetChars(bytehash).ToString(); return stringhash; } catch (Exception ex) { // Some Exception.... } return null; } ``` It's not working. It only return System.Char[]. What am I doing wrong in this