Guest User

Untitled

a guest
Jan 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. [ComVisible(true)]
  2. public string HashPassword(string password)
  3. {
  4.  
  5. byte[] salt;
  6. byte[] subkey;
  7. using (var deriveBytes = new Rfc2898DeriveBytes(password, SaltSize, PBKDF2IterCount))
  8. {
  9. salt = deriveBytes.Salt;
  10. subkey = deriveBytes.GetBytes(PBKDF2SubkeyLength);
  11. }
  12.  
  13. var outputBytes = new byte[1 + SaltSize + PBKDF2SubkeyLength];
  14. //some more code goes here
  15. return Convert.ToBase64String(outputBytes);
  16. }
Add Comment
Please, Sign In to add comment