Class AdvancedEncryptionStandardUtility
This utility class is designed to make System.
Inheritance
Namespace: Cuemon.Security.Cryptography
Assembly: Cuemon.Security.dll
Syntax
public static class AdvancedEncryptionStandardUtility
Fields
| Improve this DocBlockSize
Gets the block size (bits) for the Advanced Encryption Standard (AES)
Declaration
public static readonly byte BlockSize
Field Value
Type | Description |
---|---|
System. |
Methods
| Improve this DocDecrypt(Byte[], Byte[], Byte[])
Decrypts the specified value from the provided key
and initializationVector
.
Declaration
public static byte[] Decrypt(byte[] value, byte[] key, byte[] initializationVector)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value to decrypt. |
System. |
key | The key to use in the decryption algorithm. |
System. |
initializationVector | The initialization vector (IV) to use in the decryption algorithm. |
Returns
Type | Description |
---|---|
System. |
The decrypted value. |
Encrypt(Byte[], Byte[], Byte[])
Encrypts the specified value from the provided key
and initializationVector
.
Declaration
public static byte[] Encrypt(byte[] value, byte[] key, byte[] initializationVector)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value to encrypt. |
System. |
key | The key to use in the encryption algorithm. |
System. |
initializationVector | The initialization vector (IV) to use in the encryption algorithm. |
Returns
Type | Description |
---|---|
System. |
The encrypted value. |
GenerateInitializationVector()
Generates a random 128 bit initialization vector (IV) to be used for the algorithm.
Declaration
public static byte[] GenerateInitializationVector()
Returns
Type | Description |
---|---|
System. |
A random 128 bit generated initialization vector (IV). |
GenerateKey(AdvancedEncryptionStandardKeySize)
Generates a random key to be used for the algorithm.
Declaration
public static byte[] GenerateKey(AdvancedEncryptionStandardKeySize keySize)
Parameters
Type | Name | Description |
---|---|---|
Advanced |
keySize | The size of the key. |
Returns
Type | Description |
---|---|
System. |
A random generated key with the specified |