Beispiel #1
0
 public string ComputeHmacFromString(string toBeHashed, string key)
 {
     return(Convert.ToBase64String(Hashing.ComputeHmacSha256(Encoding.UTF8.GetBytes(toBeHashed), Encoding.UTF8.GetBytes(key))));
 }
Beispiel #2
0
 public static string HashPasswordString(string password, string salt)
 {
     return(Convert.ToBase64String(Hashing.HashPasswordWithSalt(
                                       Encoding.UTF8.GetBytes(password),
                                       Encoding.UTF8.GetBytes(salt))));
 }