예제 #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         KeyProvider.Dispose();
         rng.Dispose();
     }
 }
예제 #2
0
        public Cryptographer(string password, KeySize keySize = KeySize._256, byte saltSize = 7)
        {
            if (saltSize == 0)
            {
                throw
                    new ArgumentException("0 salt length is forbidden", nameof(saltSize));
            }

            rng         = RandomNumberGenerator.Create();
            SaltSize    = saltSize;
            KeyProvider = new KeyProvider(password, keySize, KeySize._128);
        }