public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations) { if (password == null) { throw new ArgumentNullException("password"); } Salt = salt; IterationCount = iterations; _hmac = new HMACSHA1.HMACSHA1(password); }
public Rfc2898DeriveBytes(string password, int saltSize, int iterations) { if (password == null) { throw new ArgumentNullException("password"); } if (saltSize < 0) { throw new ArgumentOutOfRangeException("invalid salt length"); } Salt = WhatsAPI.UniversalApps.Libs.Core.Encryption.CryptoTools.KeyBuilder.Key(saltSize); IterationCount = iterations; _hmac = new HMACSHA1.HMACSHA1(Encoding.UTF8.GetBytes(password)); }