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: http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf

Find the Wikipedia page of AES at:
http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

 

        You are advised not to use this implementation directly in any security product or application. Please use this AES source code only a base for starting your work. You may add some feedback mechanisms (also called Cipher Block Chaining Modes) to increase the security of this AES implementation and also to reduce security risks such as Block Replay. If you are not using any Cipher Block Chaining Mode, an adversary may be able to detect and exploit patterns in your message.

 

        There are many other encryption algorithms widely in use. Some are used for high security applications while others are used for securing personal emails and files. Some examples are: 3-Way, Akelarre, Anubis, ARIA, BaseKing, Blowfish, C2, Camellia, CAST-128, CAST-256, CIKS-1, CIPHERUNICORN-A, CIPHERUNICORN-E, CMEA, Cobra, COCONUT98, Crab, CRYPTON, CS-Cipher, DEAL, DES, DES-X, DFC, E2, FEAL, FROG, G-DES, GOST, Grand Cru, Hasty Pudding Cipher, Hierocrypt, ICE, IDEA, IDEA NXT, Iraqi, Intel Cascade Cipher, KASUMI, KHAZAD, Khufu and Khafre, KN-Cipher, Libelle, LOKI89/91, LOKI97, Lucifer, M6, MacGuffin, Madryga, MAGENTA, MARS, Mercy, MESH, MISTY1, MMB, MULTI2, NewDES, NOEKEON, NUSH, Q, RC2, RC5, RC6, REDOC, Red Pike, S-1, SAFER, SC2000, SEED, Serpent, SHACAL, SHARK, Skipjack, SMS4, Square, TEA, Triple DES, Twofish, UES, Xenon, xmx, XTEA, Zodiac etc.

        If you need simple implementations of any of these, drop us a mail. We will provide algorithms and implementations for the most sought after ones.

 

License

        No license. This is an open source and free website. Use the resources as you like. Please link to this page and give credits if you can. And promote open source.

 

Author: Niyaz PK

 

 

All Rights Reserved © 2007 Hoozi