3.1 Description
This section gives short a description about the example of AES-128, covering all five modes.
- AES-128 and five confidentiality modes are implemented at two levels. The AES algorithm is implemented in the aes.c/aes.h file.
- The five confidentiality modes are implemented in the crypt.c/crypt.h file
- The example is implemented in a way that 64 bytes (i.e. 16 input blocks) of plain text are encrypted and decrypted using all modes separately
- The decrypting message can be viewed in the terminal window
- From the result if the decrypted data is the same as the plain text, this conforms the working of each mode
- The modes can be independently enabled or disabled in the conf_example.h as shown below. By default all the modes are enabled.
/* Set to true to enable respective mode
* set to false to disable the respective mode
*/
//Enable/Disable ECB mode
#define AES_ECB true
//Enable/Disable CBC mode
#define AES_CBC true
//Enable/Disable CFB mode
#define AES_CFB true
//Enable/Disable OFB mode
#define AES_OFB true
//Enable/Disable CTR mode
#define AES_CTR true