Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string EncodePassword(string pass, string salt) //encrypt password
- {
- byte[] bytes = Encoding.Unicode.GetBytes(pass);
- byte[] src = Encoding.Unicode.GetBytes(salt);
- byte[] dst = new byte[src.Length + bytes.Length];
- Buffer.BlockCopy(src, 0, dst, 0, src.Length);
- Buffer.BlockCopy(bytes, 0, dst, src.Length, bytes.Length);
- HashAlgorithm algorithm = HashAlgorithm.Create("SHA1");
- byte[] inArray = algorithm.ComputeHash(dst);
- //return Convert.ToBase64String(inArray);
- return EncodePasswordMd5(Convert.ToBase64String(inArray));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement