Advertisement
Guest User

Untitled

a guest
May 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. string username = "bryan";
  2. string password = "test";
  3.  
  4. HMACMD5 stage1 = new HMACMD5(Encoding.ASCII.GetBytes(username));
  5. byte[] hash1 = stage1.ComputeHash(Encoding.ASCII.GetBytes(password));
  6.  
  7. ASCIIEncoding encode1 = new ASCIIEncoding();
  8. //string y = byte.Parse("y");
  9. string s = "s";
  10.  
  11. //encode1.GetBytes(
  12. // byte y2 = byte.Parse(y);
  13. // byte s2 = byte.Parse(s);
  14. char[] chars = {'y' , 's'};
  15. byte[] salt = encode1.GetBytes(chars);
  16. HMACMD5 stage2 = new HMACMD5(salt);
  17. byte[] hash2 = stage2.ComputeHash(hash1);
  18.  
  19.  
  20. string hashvalue = hash2.ToString() ;
  21.  
  22. Console.WriteLine(hashvalue);
  23. Console.Read();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement