Пример #1
0
 public static KeyIVPair FromPasswordString(string password, byte[] iv = null)
 {
     return
         (new KeyIVPair(
              password.ApplySHA256(),
              iv ?? CryptoRNG.GetRandomBytes(AesSizes.IV)
              ));
 }
Пример #2
0
 public void GenerateIV()
 {
     IV = CryptoRNG.GetRandomBytes(AesSizes.IV);
 }
Пример #3
0
 public KeyIVPair()
 {
     Key = CryptoRNG.GetRandomBytes(AesSizes.Key);
     IV  = CryptoRNG.GetRandomBytes(AesSizes.IV);
 }
Пример #4
0
 public MasterPassword()
 {
     Password           = CryptoRNG.GetRandomBytes(AesSizes.Key);
     AuthenticationHash = GeneratePasswordHash(Password);
     _mode = CryptoMode.Encryption;
 }