Appearance
Decrypt Method
Definition
- Namespace:
JASE.Crypto - Assembly:
JASE.Crypto.dll
Overloads
byte[] Decrypt(byte[] encryptedData, AesGcmOptions options)
csharp
byte[] Decrypt(byte[] encryptedData, AesGcmOptions options)Decrypts a byte array using AES-GCM with the provided associated AesGcmOptions
byte[] Decrypt(byte[] encryptedData, byte[] key, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)
csharp
byte[] Decrypt(byte[] encryptedData, byte[] key, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)Decrypts a byte array using AES-GCM with the given key and optional associated metadata.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
encryptedData | The encrypted input data as a byte array. |
key | The encryption key. |
Returns
The decrypted data as a byte array.
byte[] Decrypt(byte[] input, string passPhrase, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)
csharp
byte[] Decrypt(byte[] input, string passPhrase, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)Decrypts a self-describing JASE envelope using only a passphrase. The salt, iteration count, hash and KDF algorithm are read from the envelope itself, so no salt argument is required.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata that was bound at encrypt time. |
encoding | Optional encoding for string conversions (default is UTF-8). |
format | Envelope format. Must be a self-describing format (default: JaseV1). |
input | The encrypted input data as a byte[]. |
passPhrase | The passphrase used to derive the encryption key. |
Returns
The decrypted data as a byte array.
byte[] Decrypt(byte[] input, string passPhrase, string salt, byte[] associatedMetaData = null, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)
csharp
byte[] Decrypt(byte[] input, string passPhrase, string salt, byte[] associatedMetaData = null, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)Decrypts a Base64 encoded string using AES-GCM and a passphrase and salt.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
encoding | Optional encoding for string conversions (default is UTF-8). |
input | The encrypted input data as a byte[] |
iterations | The number of iterations used in the PBKDF2 algorithm. Higher values increase brute-force cost at the expense of CPU time. The default is 210,000 (DEFAULT_ITERATIONS), matching library-wide PBKDF2 defaults. |
passPhrase | The passphrase used to derive the encryption key. |
salt | The salt used to derive the encryption key. |
Returns
The decrypted string.
byte[] Decrypt(byte[] input, string passPhrase, string salt, string associatedMetaData, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)
csharp
byte[] Decrypt(byte[] input, string passPhrase, string salt, string associatedMetaData, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)Decrypts a Base64 encoded string using AES-GCM and a passphrase and salt.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
encoding | Optional encoding for string conversions (default is UTF-8). |
input | The encrypted input data as a byte[]. |
iterations | The number of iterations used in the PBKDF2 algorithm. Higher values increase brute-force cost at the expense of CPU time. The default is 210,000 (DEFAULT_ITERATIONS), matching library-wide PBKDF2 defaults. |
passPhrase | The passphrase used to derive the encryption key. |
salt | The salt used to derive the encryption key. |
Returns
The decrypted string.
string Decrypt(string input, AesGcmOptions options)
csharp
string Decrypt(string input, AesGcmOptions options)Decrypts a Base64 encoded string using AES-GCM with the provided associated AesGcmOptions
string Decrypt(string input, byte[] key, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)
csharp
string Decrypt(string input, byte[] key, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)Decrypts a string using AES-GCM with the given key and optional associated metadata.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
encoding | Optional encoding for string conversions (default is UTF-8). |
input | The encrypted input data as a string. |
key | The encryption key. |
Returns
The decrypted string.
string Decrypt(string base64input, string passPhrase, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)
csharp
string Decrypt(string base64input, string passPhrase, byte[] associatedMetaData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)Decrypts a self-describing JASE envelope using only a passphrase. The salt, iteration count, hash and KDF algorithm are read from the envelope itself, so no salt argument is required.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata that was bound at encrypt time. |
base64input | The encrypted input data as a Base64 encoded string. |
encoding | Optional encoding for string conversions (default is UTF-8). |
format | Envelope format. Must be a self-describing format (default: JaseV1). |
passPhrase | The passphrase used to derive the encryption key. |
Returns
The decrypted string.
string Decrypt(string base64input, string passPhrase, string salt, byte[] associatedMetaData = null, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)
csharp
string Decrypt(string base64input, string passPhrase, string salt, byte[] associatedMetaData = null, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)Decrypts a Base64 encoded string using AES-GCM and a passphrase and salt.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
base64input | The encrypted input data as a Base64 encoded string. |
encoding | Optional encoding for string conversions (default is UTF-8). |
iterations | The number of iterations used in the PBKDF2 algorithm. Higher values increase brute-force cost at the expense of CPU time. The default is 210,000 (DEFAULT_ITERATIONS), matching library-wide PBKDF2 defaults. |
passPhrase | The passphrase used to derive the encryption key. |
salt | The salt used to derive the encryption key. |
Returns
The decrypted string.
string Decrypt(string base64input, string passPhrase, string salt, string associatedMetaData, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)
csharp
string Decrypt(string base64input, string passPhrase, string salt, string associatedMetaData, Encoding encoding = null, int iterations = null, AesEnvelopeFormat? format = null)Decrypts a Base64 encoded string using AES-GCM and a passphrase and salt.
Parameters
| Name | Description |
|---|---|
associatedMetaData | Optional associated metadata for the decryption. |
base64input | The encrypted input data as a Base64 encoded string. |
encoding | Optional encoding for string conversions (default is UTF-8). |
iterations | The number of iterations used in the PBKDF2 algorithm. Higher values increase brute-force cost at the expense of CPU time. The default is 210,000 (DEFAULT_ITERATIONS), matching library-wide PBKDF2 defaults. |
passPhrase | The passphrase used to derive the encryption key. |
salt | The salt used to derive the encryption key. |
Returns
The decrypted string.