Appearance
Encrypt Method
Definition
- Namespace:
JASE.Crypto - Assembly:
JASE.Crypto.dll
Overloads
| Name | Description |
|---|---|
byte[] Encrypt(byte[] data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null) | Encrypts data with a raw key, producing the interoperable IV ‖ ciphertext layout. |
string Encrypt(string data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null) | Encrypts a string with a raw key, returning Base64 of the interoperable IV ‖ ciphertext layout. |
byte[] Encrypt(byte[] data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)
csharp
byte[] Encrypt(byte[] data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)Encrypts data with a raw key, producing the interoperable IV ‖ ciphertext layout.
Parameters
| Name | Description |
|---|---|
algorithm | Symmetric algorithm (default AES-256). |
data | The plaintext to encrypt. |
key | Raw key material (legal key size for algorithm). |
padding | Block padding mode (default PKCS7). |
Returns
Ciphertext as IV ‖ ciphertext.
string Encrypt(string data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)
csharp
string Encrypt(string data, byte[] key, SymmetricAlgorithms algorithm = null, EncryptionPaddingMode padding = null)Encrypts a string with a raw key, returning Base64 of the interoperable IV ‖ ciphertext layout.
Parameters
| Name | Description |
|---|---|
algorithm | Symmetric algorithm (default AES-256). |
data | The plaintext string to encrypt. |
key | Raw key material (legal key size for algorithm). |
padding | Block padding mode (default PKCS7). |
Returns
Base64-encoded ciphertext.