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