SecureStringEncryptor

Ecng.Serialization

Default AES-based ISecureStringEncryptor. The key and entropy are always supplied explicitly via the constructor - the built-in default secret lives in SecureStringHelper. Implement ISecureStringEncryptor directly for a completely custom scheme and assign it to Encryptor.

Implementa: ISecureStringEncryptor

Construtores

SecureStringEncryptor
public SecureStringEncryptor(SecureString key, byte[] entropy)
secureStringEncryptor = SecureStringEncryptor(key, entropy)

Initializes a new instance with the given key and entropy.

key
Encryption key.
entropy
Encryption entropy (also used as the IV salt).

Propriedades

Entropy
public byte[] Entropy { get; }
value = secureStringEncryptor.Entropy

Encryption entropy (also used as the IV salt).

Key
public SecureString Key { get; }
value = secureStringEncryptor.Key

Encryption key.

Métodos

Decrypt
public SecureString Decrypt(byte[] source)
result = secureStringEncryptor.Decrypt(source)

Decrypts previously produced by SecureString).

cipher
Encrypted bytes; returns .

Retorna: Original SecureString, or when is .

Encrypt
public byte[] Encrypt(SecureString instance)
result = secureStringEncryptor.Encrypt(instance)

Encrypts to a byte array.

value
SecureString to encrypt; returns .

Retorna: Encrypted bytes, or when is .