![]() |
BogaNet 1.4.0
|
Helper for AES cryptography. More...
Static Public Member Functions | |
static byte[] | GenerateIV (int length=16) |
Generates a secure IV for AES. | |
static byte[] | GenerateKey (int length=16) |
Generates a secure key for AES. | |
static bool | EncryptFile (string file, byte[] key, byte[] IV) |
Encrypts a file with AES. | |
static async Task< bool > | EncryptFileAsync (string file, byte[] key, byte[] IV) |
Encrypts a file with AES asynchronously. | |
static bool | DecryptFile (string file, byte[] key, byte[] IV) |
Decrypts a file with AES. | |
static async Task< bool > | DecryptFileAsync (string file, byte[] key, byte[] IV) |
Decrypts a file with AES asynchronously. | |
static byte[] | Encrypt (string textToEncrypt, byte[] key, byte[] IV, Encoding? encoding=null) |
Encrypts a string with AES. | |
static byte[] | Encrypt (byte[] dataToEncrypt, byte[] key, byte[] IV) |
Encrypts a byte-array with AES. | |
static async Task< byte[]> | EncryptAsync (byte[] dataToEncrypt, byte[] key, byte[] IV) |
Encrypts a byte-array with AES asynchronously. | |
static byte[] | Decrypt (byte[] dataToDecrypt, byte[] key, byte[] IV) |
Decrypts a byte-array with AES. | |
static async Task< byte[]> | DecryptAsync (byte[] dataToDecrypt, byte[] key, byte[] IV) |
Decrypts a byte-array with AES asynchronously. | |
Helper for AES cryptography.
|
static |
Decrypts a byte-array with AES.
dataToDecrypt | byte-array to decrypt |
key | Key for the byte-array as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Decrypts a byte-array with AES asynchronously.
dataToDecrypt | byte-array to decrypt |
key | Key for the byte-array as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Decrypts a file with AES.
file | File to decrypt |
key | Key for the file as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Decrypts a file with AES asynchronously.
file | File to decrypt |
key | Key for the file as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Encrypts a byte-array with AES.
dataToEncrypt | byte-array to encrypt |
key | Key for the byte-array as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Encrypts a string with AES.
textToEncrypt | string to encrypt |
key | Key for the byte-array as byte-array |
IV | IV (initial vector) for AES |
encoding | Encoding of the string (optional, default: UTF8) |
Exception |
|
static |
Encrypts a byte-array with AES asynchronously.
dataToEncrypt | byte-array to encrypt |
key | Key for the byte-array as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Encrypts a file with AES.
file | File to encrypt |
key | Key for the file as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Encrypts a file with AES asynchronously.
file | File to encrypt |
key | Key for the file as byte-array |
IV | IV (initial vector) for AES |
Exception |
|
static |
Generates a secure IV for AES.
length | Length of the IV (optional, range: 16 - 32, default: 16) |
|
static |
Generates a secure key for AES.
length | Length of the key (optional, range: 16 - 128, default: 16) |