Public Types | |
enum | EncryptMode { ECB = 0, CBC = 1, CFB = 2 } |
enum | { DEFAULT_BLOCK_SIZE = 16 } |
enum | { MAX_BLOCK_SIZE = 32, MAX_ROUNDS = 14, MAX_KC = 8, MAX_BC = 8 } |
Static Public Member Functions | |
static PROUD_API bool | ExpandFrom (CCryptoAesKey &outKey, const uint8_t *const inputKey, int keyLength=DEFAULT_BLOCK_SIZE, int blockSize=DEFAULT_BLOCK_SIZE) |
static int | GetEncryptSize (const CCryptoAesKey &key, int inputLength) |
static bool | Encrypt (const CCryptoAesKey &key, const uint8_t *const input, int inputLength, uint8_t *output, int &outputLength, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
static bool | Decrypt (const CCryptoAesKey &key, const uint8_t *const input, int inputLength, uint8_t *output, int &outputLength, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
static bool | EncryptByteArray (const CCryptoAesKey &key, const ByteArray &input, ByteArray &output, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
static PROUD_API bool | DecryptByteArray (const CCryptoAesKey &key, const ByteArray &input, ByteArray &output, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
static PROUD_API bool | EncryptMessage (const CCryptoAesKey &key, const CMessage &input, CMessage &output, int offset, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
static PROUD_API bool | DecryptMessage (const CCryptoAesKey &key, const CMessage &input, CMessage &output, int offset, uint8_t *initializationVector=NULL, int initializationVectorLength=0, EncryptMode encryptMode=ECB) |
Rijndael (pronounced Reindaal) is a block cipher, designed by Joan Daemen and Vincent Rijmen as a candidate algorithm for the AES. The cipher has a variable block length and key length. The authors currently specify how to use keys with a length of 128, 192, or 256 bits to encrypt blocks with length of 128, 192 or 256 bits (all nine combinations of key length and block length are possible). Both block length and key length can be extended very easily to multiples of 32 bits.
Rijndael can be implemented very efficiently on a wide range of processors and in hardware.
This implementation is based on the Java Implementation used with the Cryptix toolkit found at: http://www.efgh.com/software/rijndael.zip
Java code authors: Raif S. Naffah, Paulo S. L. M. Barreto
This Implementation was tested against KAT test published by the authors of the method and the results were identical.
|
static |
Decrypt data
key | Symmetric key |
input | Encrypted message |
inputLength | Size of Encrypted message |
output | Decrypted result value |
outputLength | Size of Decrypted text |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
Decrypt ByteArray
key | Symmetric key |
input | Encrypted message |
output | Decrypted result value |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
Decrypt Message
key | Symmetric key |
input | Encrypted message |
output | Decrypted result value |
offset | Decrypt start position at encrypted message |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
Encrypt data
key | Symmetric key |
input | Plain text message |
inputLength | Size of plain text |
output | Encrypted result value |
outputLength | Size of Encrypted result |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
Encrypt ByteArray
key | Symmetric key |
input | Plain text message |
output | Encrypted result value |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
Encrypt Message
key | Symmetric key |
input | Plain text message |
output | Encrypted result value |
offset | Encrypt start position at plain text message |
initializationVector | Initialization Vector (IV) for CBC or CFB mode encryption. |
initializationVectorLength | Length of initializationVector in bytes. |
encryptMode | Encryption mode. (ECB, CBC, CFB mode) |
|
static |
TODO:translate needed. When the length of the key and the block is 128bit – 9 rounds
outKey | Generated encryption key is saved |
inputKey | The 128/192/256-bit can be used and this is the random block data to make the initial Aes key. |
keyLength | It’s either 16, 24 or 32 bytes |
This | is the block size within the Aes algorithm (16, 24 or 32 bytes). |
|
static |
key | Symmetric key |
inputLength | Size of plain text |