Advanced Encryption Standard (AES) Implementation in C/C++ with comments.

AES (Advanced Encryption Standard) is the latest standard for symmetric key encryption/decryption which was selected by National Institute of Standards and Technology (NIST), USA. It has been proven to be much secure than most other encryption algorithms used today. It uses key lengths of 128,192 or 256 bits. The original algorithm is called Rijndael (Rain-doll).


The implementations given here is in C / C++. It is given as an aid for beginners to get acquainted with the algorithm and can be used as a base for actual implementation. The main feature of this AES implementation is not efficiency; It is simplicity and readability.


The implementation is provided in two parts. One for encryption and other for decryption. Both are stand alone programs. Please note that classes or any other OOP construct is not used in this implementation. It is advised not to use classes or high end data structures in the implementations since that can affect the performance of the algorithm seriously.

Get the source codes here:

(1) AES Encryption source code in C/C++

(2) AES Decryption source code in C/C+


Comments are provided as needed to understand the program. But the user must read some AES documentation to understand the underlying theory correctly. It is not possible to describe the complete AES algorithm in detail here. For the complete description of the algorithm, point your browser to:

Find the Wikipedia page of AES at:

Copyright © 2020 Hoozi Resources