protected virtual void Dispose(bool disposing) { if (disposing) { KeyProvider.Dispose(); rng.Dispose(); } }
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); }