Written By: Adam Berent
Advanced Encryption Standard by Example
The following document provides a detailed and easy to understand explanation of the implementation of the AES
(RIJNDAEL) encryption algorithm. The purpose of this paper is to give developers with little or no knowledge of
cryptography the ability to implement AES.
There are terms that are frequently used throughout this paper that need to be clarified.
Block: AES is a block cipher. This means that the number of bytes that it encrypts is fixed. AES can currently encrypt
blocks of 16 bytes at a time; no other block sizes are presently a part of the AES standard. If the bytes being
encrypted are larger than the specified block then AES is executed concurrently. This also means that AES has to
encrypt a minimum of 16 bytes. If the plain text is smaller than 16 bytes then it must be padded.
Simply said the block is a reference to the bytes that are processed by the algorithm.
State: Defines the current condition (state) of the block. That is the block of bytes that are currently being worked on. The
state starts off being equal to the block, however it changes as each round of the algorithms executes. Plainly said
this is the block in progress.
XOR Refers to the bitwise operator Exclusive Or. XOR operates on the individual bits in a byte in the following way:
0 XOR 0 = 0
1 XOR 0 = 1
1 XOR 1 = 0
0 XOR 1 = 1
For example the Hex digits D4 XOR FF
00101011 (Hex 2B)
Another interesting property of the XOR operator is that it is reversible. So Hex 2B XOR FF = D4
Most programming languages have the XOR operator built in.
HEX: Defines a notation of numbers in base 16. This simply means that; the highest number that can be represented in
a single digit is 15, rather than t