Exemple #1
0
 /// <summary>
 /// Creates Argon2-hash of password.
 /// </summary>
 /// <param name="enteredPassword">String password.</param>
 /// <returns>Hash.</returns>
 public string HashPassword(string enteredPassword)
 {
     return(PasswordManager.HashPassword(enteredPassword, CreateSalt(enteredPassword)));
 }
Exemple #2
0
 /// <summary>
 /// Verifies password given compared to users password.
 /// </summary>
 /// <param name="enteredPassword">Password to verify.</param>
 /// <returns>True if match, else False.</returns>
 public bool VerifyPassword(string enteredPassword)
 {
     return(PasswordManager.VerifyPassword(enteredPassword, Password, CreateSalt(enteredPassword)));
 }
Exemple #3
0
 /// <summary>
 /// Creates salt based on user info.
 /// </summary>
 /// <param name="enterPassword">String password.</param>
 /// <returns>Salt based on user info.</returns>
 private byte[] CreateSalt(string enterPassword)
 {
     return(PasswordManager.CreateSalt(GUID + enterPassword));
 }
 /// <summary>
 /// Creates salt based on user info.
 /// </summary>
 /// <param name="enterPassword">String password.</param>
 /// <returns>Salt based on user info.</returns>
 private byte[] CreateSalt(string enterPassword)
 {
     return(PasswordManager.CreateSalt(Age + Name + enterPassword + Address + Username));
 }