예제 #1
0
 public byte[] Encryption(byte[] pass, byte[] salt, int iterations)
 {
     if (salt.Length != 16)
     {
         throw new ArgumentException("Salt must be equal to 16 byte");
     }
     if (iterations < 4 || iterations > 31)
     {
         throw new ArgumentException("Bad number of rounds", "logRounds");
     }
     return(BCryptHlper.HashPassword(pass, salt, iterations));
 }
예제 #2
0
 public bool VerifyPassword(byte[] encryData, byte[] pass, byte[] salt, int iterations)
 {
     return(BCryptHlper.Verify(encryData, pass, salt, iterations));
 }