nn::crypto NamespaceThe namespace of the encryption library.
Encryption using a block cipher has the following four stages, depending on the sophistication of the API.
If at all possible, use the first stage, wherein a single function performs all operations.
It includes functions such as EncryptAes128Ctr, DecryptAes128Ctr, EncryptAndGenerateAes128Ccm, and DecryptAndVerifyAes128Ccm.
Perform all processing required to encrypt by calling only this one function and specifying the encryption key, data to encrypt, and buffer to store the results.
This uses an instance of a class derived from BlockCipher and one of the following functions.
Encrypt function from the Encryptor derived class
Decrypt function from the Decryptor derived class
EncryptAndGenerate function from AuthenticatedEncryptor derived class
DecryptAndVerify function from the AuthenticatedDecryptor derived class
Uses instances of a class derived from BlockCipher, and a class derived from CipherMode. You can use any combination of block cipher and cipher mode. You can process a little at a time this way, allowing you to process a large volume of data using a smaller buffer to load and process the data.
Uses only an instance of a class derived from BlockCipher.
Do not use this method unless you know enough about encryption, and have a firm understanding of what you are doing.
| Block Cipher (Concrete Class) | |
|---|---|
nn::crypto::Aes
|
Class for implementing AES ciphers. |
nn::crypto::CcmDecryptor
|
Class for decrypting and verifying in CCM mode. |
nn::crypto::CcmEncryptor
|
Class for encrypting and generating an MAC in CCM mode. |
nn::crypto::CtrDecryptor
|
Class for decrypting in CTR mode. |
nn::crypto::CtrEncryptor
|
Class for encrypting in CTR mode. |
| Block Cipher (Abstract Class) | |
nn::crypto::AuthenticatedDecryptor
|
Base class for classes that decrypt ciphertexts with MAC and verify them. |
nn::crypto::AuthenticatedEncryptor
|
Base class for classes that encrypt with MAC. |
nn::crypto::BlockCipher
|
Base class for classes that implement block ciphers. |
nn::crypto::CipherMode
|
Base class for the cipher mode classes. |
nn::crypto::Decryptor
|
Base class for classes performing decryption using a cipher mode. |
nn::crypto::Encryptor
|
Base class for classes that perform encryption using a cipher mode. |
| Hash | |
nn::crypto::HashContextBase
|
Base class for context objects used for hash calculation. |
nn::crypto::Sha1Context
|
Context object for SHA-1 calculation. |
nn::crypto::Sha256Context
|
Context object for SHA-256 calculation. |
nn::crypto::ShaBlock512BitContext
|
Context object for SHA calculation with a BlockSize of 512 bits. |
| RSA | |
nn::crypto::RsaContext
|
The context class for RSA public key encryption. |
nn::crypto::RsaKey
|
The RSA key class. |
Aes128
|
Class for AES encryption with a key length of 128 bits. | |
|---|---|---|
Aes192
|
Class for AES encryption with a key length of 192 bits. | |
Aes256
|
Class for AES encryption with a key length of 256 bits. | |
CtrDecryptor128
|
CtrDecryptor class for a block size of 128 bits. |
|
CtrEncryptor128
|
CtrEncryptor class for a block size of 128 bits. |
ENCRYPT_HEADER_SIZE
|
const size_t |
Amount by which data size increases when encrypted using the EncryptAes128Ctr function. |
|
|---|---|---|---|
GENERATE_HEADER_SIZE
|
const size_t |
Amount by which data size increases when encrypted using the EncryptAndGenerateAes128Ccm function. |
EncryptAes128Ctr
|
Encrypts. | |
|---|---|---|
DecryptAes128Ctr
|
Decrypts. | |
EncryptAndGenerateAes128Ccm
|
Encrypts and generates data for tampering tests. | |
DecryptAndVerifyAes128Ccm
|
Decrypts and tests for tampering. |
|
GenerateRandomBytes
|
Generates a pseudo-random number. | |
CalculateHmacSha1
|
Performs HMAC-SHA1 calculation. | |
CalculateHmacSha256
|
Performs HMAC-SHA256 calculation. | |
CalculateSha1
|
Utility function that encompasses a sequence of operations used for SHA-1 calculation. | |
CalculateSha256
|
Utility function that encompasses a sequence of operations used for SHA-256 calculation. |
CONFIDENTIAL