PCL
|
AES-256 cipher. More...
#include <Cryptography.h>
Public Types | |
using | block_type = uint8[block_length] |
using | key_type = uint8[key_length] |
Public Member Functions | |
AES256 (const AES256 &)=default | |
AES256 (IsoString &key) | |
AES256 (void *key) | |
~AES256 () override | |
String | AlgorithmName () const override |
void | Decrypt (void *output, const void *input, size_type length) const override |
void | DecryptBlock (void *output, const void *input) const |
void | Encrypt (void *output, const void *input, size_type length) const override |
void | EncryptBlock (void *output, const void *input) const |
size_type | KeyLength () const override |
AES256 & | operator= (const AES256 &)=default |
Public Member Functions inherited from pcl::Cipher | |
Cipher ()=default | |
Cipher (const Cipher &)=default | |
virtual | ~Cipher () |
template<class C > | |
ByteArray | Decrypt (const C &input) const |
template<class C > | |
void | Decrypt (void *output, const C &input) const |
template<class C > | |
ByteArray | Encrypt (const C &input) const |
template<class C > | |
void | Encrypt (void *output, const C &input) const |
Cipher & | operator= (const Cipher &)=default |
The AES256 class is a FIPS-197 compliant implementation of the Advanced Encryption Standard (AES) cipher using 256-bit keys.
References
The AES (Advanced Encryption Standard) block cipher algorithm (originally called Rijndael) was designed by Vincent Rijmen and Joan Daemen:
http://csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
Definition at line 933 of file Cryptography.h.
using pcl::AES256::block_type = uint8[ block_length ] |
Represents a 16-byte ECB encryption/decription block for the AES-256 algorithm.
Definition at line 948 of file Cryptography.h.
using pcl::AES256::key_type = uint8[ key_length ] |
Represents a 256-bit cipher key for the AES-256 algorithm.
Definition at line 942 of file Cryptography.h.
|
inline |
Constructs an AES-256 cipher object.
key | Starting address of a contiguous block of 32 bytes, which will be treated as the 256-bit cipher key. The first 32 bytes stored at this address will be wiped out (replaced with zeros) by this constructor. |
Definition at line 963 of file Cryptography.h.
|
inline |
Constructs an AES-256 cipher object.
key | 256-bit cipher key specified as an 8-bit string. The contents of this string Will be wiped out (filled with null characters) by this constructor. |
The AES-256 cipher key will be initialized with the lowercase hexadecimal representation of 20 successive MD5 checksum operations applied to the specified key string (note that an MD5 checksum is a sequence of 16 bytes, whose hexadecimal representation has 32 characters, or 256 bits).
Definition at line 986 of file Cryptography.h.
References pcl::GenericString< T, R, A >::Begin(), pcl::Array< T, A >::Fill(), pcl::CryptographicHash::Hash(), pcl::GenericString< T, R, A >::SecureFill(), and pcl::IsoString::ToHex().
|
default |
Copy constructor.
|
inlineoverride |
Destroys an AES-256 cipher object.
Definition at line 1010 of file Cryptography.h.
|
inlineoverridevirtual |
Returns "AES256", the name of this cipher algorithm.
Implements pcl::Cipher.
Definition at line 1017 of file Cryptography.h.
|
overridevirtual |
AES buffer decryption (CBC mode).
[out] | output | Starting address of the output buffer, where the decrypted data (or plain text) will be stored. |
input | Starting address of the input buffer, where the encrypted data (or cipher text) is stored. | |
length | The buffer length in bytes. Must be an integer multiple of 16 bytes. |
If the specified length is not an integer multiple of 16 bytes, this function throws an Error exception.
Implements pcl::Cipher.
void pcl::AES256::DecryptBlock | ( | void * | output, |
const void * | input | ||
) | const |
AES block decryption (ECB mode).
[out] | output | Starting address of the decrypted 16-byte block. |
input | Starting address of the input 16-byte block. |
|
overridevirtual |
AES-256 buffer encryption (CBC mode).
[out] | output | Starting address of the output buffer, where the encrypted data (or cipher text) will be stored. |
input | Starting address of the input buffer, where the original data (or plain text) is stored. | |
length | The buffer length in bytes. Must be an integer multiple of 16 bytes. |
If the specified length is not an integer multiple of 16 bytes, this function throws an Error exception. If necessary, the source data must be padded with zeros or spaces, as required to achieve a valid length.
Implements pcl::Cipher.
void pcl::AES256::EncryptBlock | ( | void * | output, |
const void * | input | ||
) | const |
AES block encryption (ECB mode).
[out] | output | Starting address of the encrypted 16-byte block. |
input | Starting address of the input 16-byte block. |
|
inlineoverridevirtual |
Returns 32, the length in bytes of a key in the AES-256 cipher algorithm.
Implements pcl::Cipher.
Definition at line 1025 of file Cryptography.h.
Copy assignment operator. Returns a reference to this object.