Skip to content

DecryptWithPassword Method ​

Definition ​

  • Namespace: JASE.Crypto
  • Assembly: JASE.Crypto.dll

Overloads ​

NameDescription
byte[] DecryptWithPassword(byte[] data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)Decrypts a password container produced by EncryptWithPassword. The salt and iteration count are read from the container.
string DecryptWithPassword(string data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)Decrypts a Base64 password container produced by EncryptWithPassword.

byte[] DecryptWithPassword(byte[] data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null) ​

csharp
byte[] DecryptWithPassword(byte[] data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)

Decrypts a password container produced by EncryptWithPassword. The salt and iteration count are read from the container.

Parameters ​

NameDescription
algorithmSymmetric algorithm (default AES-256).
dataThe password container (saltLen ‖ salt ‖ iterations ‖ IV ‖ ciphertext).
paddingBlock padding mode (default PKCS7).
passwordThe passphrase. PBKDF2 uses its UTF-8 bytes.

Returns ​

The decrypted plaintext.

string DecryptWithPassword(string data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null) ​

csharp
string DecryptWithPassword(string data, string password, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)

Decrypts a Base64 password container produced by EncryptWithPassword.

Parameters ​

NameDescription
algorithmSymmetric algorithm (default AES-256).
dataBase64-encoded password container.
paddingBlock padding mode (default PKCS7).
passwordThe passphrase. PBKDF2 uses its UTF-8 bytes.

Returns ​

The decrypted string.