The Advanced Encryption Standard (AES), also known by its original name Rijndael (),
is a specification for the
encryption
In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can dec ...
of electronic data established by the U.S.
National Institute of Standards and Technology
The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into Outline of p ...
(NIST) in 2001.
AES is a variant of the Rijndael
block cipher
In cryptography, a block cipher is a deterministic algorithm operating on fixed-length groups of bits, called ''blocks''. Block ciphers are specified cryptographic primitive, elementary components in the design of many cryptographic protocols and ...
developed by two
Belgian cryptographers,
Joan Daemen and
Vincent Rijmen
Vincent Rijmen (; born 16 October 1970) is a Belgian cryptographer and one of the two designers of the Rijndael, the Advanced Encryption Standard. Rijmen is also the co-designer of the WHIRLPOOL cryptographic hash function, and the block cip ...
, who submitted a proposal
to NIST during the
AES selection process. Rijndael is a family of ciphers with different key and block sizes. For AES, NIST selected three members of the Rijndael family, each with a block size of 128 bits, but three different key lengths: 128, 192 and 256 bits.
AES has been adopted by the
U.S. government
The federal government of the United States (U.S. federal government or U.S. government) is the national government of the United States, a federal republic located primarily in North America, composed of 50 states, a city within a fede ...
. It supersedes the
Data Encryption Standard
The Data Encryption Standard (DES ) is a symmetric-key algorithm for the encryption of digital data. Although its short key length of 56 bits makes it too insecure for modern applications, it has been highly influential in the advancement of cr ...
(DES), which was published in 1977. The algorithm described by AES is a
symmetric-key algorithm, meaning the same key is used for both encrypting and decrypting the data.
In the United States, AES was announced by the NIST as U.S.
FIPS PUB 197 (FIPS 197) on November 26, 2001.
This announcement followed a five-year standardization process in which fifteen competing designs were presented and evaluated, before the Rijndael cipher was selected as the most suitable.
[See ]Advanced Encryption Standard process
The Advanced Encryption Standard (AES), the symmetric block cipher ratified as a standard by National Institute of Standards and Technology of the United States (NIST), was chosen using a process lasting from 1997 to 2000 that was markedly more ...
for more details.
AES is included in the
ISO/
IEC 18033-3 standard. AES became effective as a U.S. federal government standard on May 26, 2002, after approval by the U.S.
Secretary of Commerce. AES is available in many different encryption packages, and is the first (and only) publicly accessible
cipher approved by the U.S.
National Security Agency
The National Security Agency (NSA) is a national-level intelligence agency of the United States Department of Defense, under the authority of the Director of National Intelligence (DNI). The NSA is responsible for global monitoring, collectio ...
(NSA) for
top secret information when used in an NSA approved cryptographic module.
[See Security of AES below.]
Definitive standards
The Advanced Encryption Standard (AES) is defined in each of:
* FIPS PUB 197: Advanced Encryption Standard (AES)
* ISO/IEC 18033-3: Block ciphers
Description of the ciphers
AES is based on a design principle known as a
substitution–permutation network, and is efficient in both software and hardware. Unlike its predecessor DES, AES does not use a
Feistel network. AES is a variant of Rijndael, with a fixed
block size of 128
bit
The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented a ...
s, and a
key size of 128, 192, or 256 bits. By contrast, Rijndael ''per se'' is specified with block and key sizes that may be any multiple of 32 bits, with a minimum of 128 and a maximum of 256 bits. Most AES calculations are done in a particular
finite field
In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subt ...
.
AES operates on a 4 × 4
column-major order array of 16 bytes
termed the ''state'':
[Large-block variants of Rijndael use an array with additional columns, but always four rows.]
::
The key size used for an AES cipher specifies the number of transformation rounds that convert the input, called the
plaintext, into the final output, called the
ciphertext. The number of rounds are as follows:
* 10 rounds for 128-bit keys.
* 12 rounds for 192-bit keys.
* 14 rounds for 256-bit keys.
Each round consists of several processing steps, including one that depends on the encryption key itself. A set of reverse rounds are applied to transform ciphertext back into the original plaintext using the same encryption key.
High-level description of the algorithm
# round keys are derived from the cipher key using the
AES key schedule. AES requires a separate 128-bit round key block for each round plus one more.
# Initial round key addition:
## each byte of the state is combined with a byte of the round key using
bitwise xor.
# 9, 11 or 13 rounds:
## a
non-linear substitution step where each byte is replaced with another according to a
lookup table.
## a transposition step where the last three rows of the state are shifted cyclically a certain number of steps.
## a linear mixing operation which operates on the columns of the state, combining the four bytes in each column.
##
# Final round (making 10, 12 or 14 rounds in total):
##
##
##
The step
In the step, each byte
in the ''state'' array is replaced with a
using an 8-bit
substitution box
In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring S ...
. Note that before round 0, the ''state'' array is simply the plaintext/input. This operation provides the non-linearity in the
cipher. The S-box used is derived from the
multiplicative inverse
In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a fraction ''a''/''b ...
over , known to have good non-linearity properties. To avoid attacks based on simple algebraic properties, the S-box is constructed by combining the inverse function with an invertible
affine transformation
In Euclidean geometry, an affine transformation or affinity (from the Latin, ''affinis'', "connected with") is a geometric transformation that preserves lines and parallelism, but not necessarily Euclidean distances and angles.
More generall ...
. The S-box is also chosen to avoid any fixed points (and so is a
derangement), i.e.,
, and also any opposite fixed points, i.e.,
.
While performing the decryption, the step (the inverse of ) is used, which requires first taking the inverse of the affine transformation and then finding the multiplicative inverse.
The step
The step operates on the rows of the state; it cyclically shifts the bytes in each row by a certain
offset. For AES, the first row is left unchanged. Each byte of the second row is shifted one to the left. Similarly, the third and fourth rows are shifted by offsets of two and three respectively.
[Rijndael variants with a larger block size have slightly different offsets. For blocks of sizes 128 bits and 192 bits, the shifting pattern is the same. Row is shifted left circular by bytes. For a 256-bit block, the first row is unchanged and the shifting for the second, third and fourth row is 1 byte, 3 bytes and 4 bytes respectively—this change only applies for the Rijndael cipher when used with a 256-bit block, as AES does not use 256-bit blocks.] In this way, each column of the output state of the step is composed of bytes from each column of the input state. The importance of this step is to avoid the columns being encrypted independently, in which case AES would degenerate into four independent block ciphers.
The step
In the step, the four bytes of each column of the state are combined using an invertible
linear transformation. The function takes four bytes as input and outputs four bytes, where each input byte affects all four output bytes. Together with , provides
diffusion
Diffusion is the net movement of anything (for example, atoms, ions, molecules, energy) generally from a region of higher concentration to a region of lower concentration. Diffusion is driven by a gradient in Gibbs free energy or chemical p ...
in the cipher.
During this operation, each column is transformed using a fixed matrix (matrix left-multiplied by column gives new value of column in the state):
::
Matrix multiplication is composed of multiplication and addition of the entries. Entries are bytes treated as coefficients of polynomial of order
. Addition is simply XOR. Multiplication is modulo irreducible polynomial
. If processed bit by bit, then, after shifting, a conditional
XOR with 1B
16 should be performed if the shifted value is larger than FF
16 (overflow must be corrected by subtraction of generating polynomial). These are special cases of the usual multiplication in
.
In more general sense, each column is treated as a polynomial over
and is then multiplied modulo
with a fixed polynomial
. The coefficients are displayed in their
hexadecimal
In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, h ...
equivalent of the binary representation of bit polynomials from