Salmon
Loading...
Searching...
No Matches
Mku.Salmon.Decryptor Class Reference

Utility class that decrypts byte arrays. More...

Public Member Functions

 Decryptor ()
 Instantiate an encryptor.
 
 Decryptor (int threads)
 Instantiate an encryptor with parallel tasks and buffer size.
 
 Decryptor (int threads, int bufferSize)
 Instantiate an encryptor with parallel tasks and buffer size.
 
byte[] Decrypt (byte[] data, byte[] key, byte[] nonce=null, EncryptionFormat format=EncryptionFormat.Salmon, bool integrity=true, byte[] hashKey=null, int chunkSize=0)
 Decrypt a byte array using AES256 based on the provided key and nonce.
 
void Close ()
 Close all associated resources.
 

Detailed Description

Utility class that decrypts byte arrays.

Constructor & Destructor Documentation

◆ Decryptor() [1/2]

Mku.Salmon.Decryptor.Decryptor ( int threads)

Instantiate an encryptor with parallel tasks and buffer size.

Parameters
threadsThe number of threads to use.

◆ Decryptor() [2/2]

Mku.Salmon.Decryptor.Decryptor ( int threads,
int bufferSize )

Instantiate an encryptor with parallel tasks and buffer size.

Parameters
threadsThe number of threads to use.
bufferSizeThe buffer size to use. It is recommended for performance to use a multiple of the chunk size if you enabled integrity otherwise a multiple of the AES block size (16 bytes).

Member Function Documentation

◆ Decrypt()

byte[] Mku.Salmon.Decryptor.Decrypt ( byte[] data,
byte[] key,
byte[] nonce = null,
EncryptionFormat format = EncryptionFormat::Salmon,
bool integrity = true,
byte[] hashKey = null,
int chunkSize = 0 )

Decrypt a byte array using AES256 based on the provided key and nonce.

Parameters
dataThe input data to be decrypted.
keyThe AES key to use for decryption.
nonceThe nonce to use for decryption.
formatThe EncryptionFormat.
integrityVerify hash integrity in the data.
hashKeyThe hash key to be used for integrity.
chunkSizeThe chunk size.
Returns
The byte array with the decrypted data.
Exceptions
IOExceptionThrown if there is a problem with decoding the array.
SecurityExceptionThrown if the key and nonce are not provided.
IOExceptionThrown if error during IO
IntegrityExceptionThrown when data are corrupt or tampered with.

The documentation for this class was generated from the following file: