Cryptocurrency · 2001

Advanced Encryption Standard (AES)

National Institute of Standards and Technology

Excerpt · FIPS 197 · Published 26 November 2001 · Updated 9 May 2023

The poster PDF, wallpaper

Retrieved
27 September 2026
License
Public domain (U.S. Government work)
Rights holder
National Institute of Standards and Technology, 2001, 2023
Language
English
About this edition and its rights

Edition

FIPS 197, Advanced Encryption Standard (AES), published 26 November 2001 and updated 9 May 2023 (NIST FIPS 197-upd1, https://doi.org/10.6028/NIST.FIPS.197-upd1), the PDF published by NIST (46 pages, 1184436 bytes, SHA-256 62c86eb567f13edb8f71826e985da870b04ef6381634f303cdb16e84d47becd1). The update is used rather than the 2001 text: its algorithm is the same, and its text, notation and figures are the current ones. Excerpt: item 3 (Explanation) of the announcement in the header, then, complete and in their order, Sections 3.4 The State, 3.5 Arrays of Words, 4.2 Multiplication in GF(2^8), the introduction of Section 5 with Table 3 and its footnote, 5.1 CIPHER() with Algorithm 1, 5.1.1 to 5.1.4 with Table 4 (the S-box) and Figures 1 to 5, and 5.2 KEYEXPANSION() with Table 5 and Algorithm 2; the closing sentence of 5.2, which points to Figures 6 to 8 (not reproduced), and all other sections are left out. The prose comes from pdftotext and was checked word for word against the pages; the PDF gives no text for the fi and ffi ligatures, which were restored as printed (specified, first, final, fixed, field, coefficient and the like), and two words split at a line end are rejoined as printed (four-by-four, appropriate). Formulas, matrices and the pseudocode are set in KaTeX from the page scans (the words of the pseudocode were compared with the extracted text by script), with function names in small capitals as in the Standard. Tables 3, 4 and 5 are set from the extracted text; the S-box and the round constants were checked by computing them. The sentence that Table 4 interrupts in the Standard is set whole before the table. The footnote is numbered 1 on the poster (2 in the Standard). Figures 1 to 5 are redrawn as vector graphics after the figures of the Standard, without their shadows; their captions are set below them.

Rights

In the United States, a work of the federal government (17 U.S.C. 105): the Standard was prepared and issued by the National Institute of Standards and Technology, an agency of the U.S. Department of Commerce, and carries no copyright notice. In France, the rule of the shorter term (article L. 123-12 of the Code de la propriété intellectuelle, after article 7(8) of the Berne Convention): for a work whose country of origin is outside the European Union and whose author is not a national of a member state, the protection lasts as long as in the country of origin, which grants none.

NIST, Copyrights and Disclaimers (https://www.nist.gov/oism/copyrights, read on 27 September 2026): “With the exception of material marked as copyrighted, information presented on NIST sites are considered public information and may be distributed or copied. Use of appropriate byline/photo/image credits is requested.” The PDF has no copyright mark. The algorithm is Rijndael, designed by Joan Daemen and Vincent Rijmen, Belgian nationals; the text of the Standard is NIST’s.

Explanation The Advanced Encryption Standard (AES) specifies a FIPS-approved cryptographic algorithm that can be used to protect electronic data. The AES algorithm is a symmetric block cipher that can encrypt (encipher) and decrypt (decipher) digital information. The AES algorithm is capable of using cryptographic keys of 128, 192, and 256 bits to encrypt and decrypt data in blocks of 128 bits.

3.4 The State#

Internally, the algorithms for the AES block ciphers are performed on a two-dimensional (four-by-four) array of bytes called the state. In the state array, denoted by , each individual byte has two indices: a row index in the range and a column index in the range . An individual byte of the state is denoted by either or .

In the specifications for the AES block cipher algorithms in Section 5, the first step is to copy the input array of bytes to the state array as follows:

A sequence of transformations is then applied to the state array, after which its final value is copied to the output array of bytes as follows:

The correspondence between the indices of the input and output with the indices of the state array is illustrated in Fig. 1.

input bytesin0in1in2in3in4in5in6in7in8in9in10in11in12in13in14in15state arrays0,0s1,0s2,0s3,0s0,1s1,1s2,1s3,1s0,2s1,2s2,2s3,2s0,3s1,3s2,3s3,3output bytesout0out1out2out3out4out5out6out7out8out9out10out11out12out13out14out15

Figure 1. State array input and output

3.5 Arrays of Words#

A word is a sequence of four bytes; a block consists of four words. The four columns of state array are interpreted as an array of four words as follows, in the notation of Fig. 1:

Thus, the column index of becomes the index for , and the row index of becomes the index for the four bytes in each word.

Given a one-dimensional array of words, denotes the word that is indexed by , and the sequence of four words is denoted by .

4.2 Multiplication in GF(28)#

The symbol denotes multiplication in . Conceptually, this multiplication is defined on two bytes in two steps: 1) the two polynomials that represent the bytes are multiplied as polynomials, and 2) the resulting polynomial is reduced modulo the following fixed polynomial:

Within both steps, the individual coefficients of the polynomials are reduced modulo 2.

Thus, if and represent bytes and , then is represented by the following modular reduction of their product as polynomials:

The modular reduction by may be applied to intermediate steps in the calculation of ; consequently, it is useful to consider the special case that (i.e., ). In particular, the product can be expressed as a function of , denoted by xTimes, as follows:

Multiplication by higher powers of (such as , , and ) can be implemented by the repeated application of xTimes(). For example, let :

These products facilitate the computation of any multiple of . For example, because , it follows that

5. Algorithm Specifications#

The general function for executing AES-128, AES-192, or AES-256 is denoted by Cipher(); its inverse is denoted by InvCipher().1

The core of the algorithms for Cipher() and InvCipher() is a sequence of fixed transformations of the state called a round. Each round requires an additional input called the round key; the round key is a block that is usually represented as a sequence of four words (i.e., 16 bytes).

An expansion routine, denoted by KeyExpansion(), takes the block cipher key as input and generates the round keys as output. In particular, the input to KeyExpansion() is represented as an array of words, denoted by key, and the output is an expanded array of words, denoted by w, called the key schedule.

The block ciphers AES-128, AES-192, and AES-256 differ in three respects: 1) the length of the key; 2) the number of rounds, which determines the size of the required key schedule; and 3) the specification of the recursion within KeyExpansion(). For each algorithm, the number of rounds is denoted by Nr, and the number of words of the key is denoted by Nk. (The number of words in the state is denoted by Nb for Rijndael in general; in this Standard, .) The specific values of Nk, Nb, and Nr are given in Table 3. No other configurations of Rijndael conform to this Standard.

For implementation issues relating to the key length, block size, and number of rounds, see Section 6.3.

Table 3. Key-Block-Round Combinations

Key lengthBlock sizeNumber of rounds
Nk(in bits)Nb(in bits)Nr
AES-1284128412810
AES-1926192412812
AES-2568256412814

The three inputs to Cipher() are: 1) the data input in, which is a block represented as a linear array of 16 bytes; 2) the number of rounds Nr for the instance; and 3) the round keys. Thus,

The inverse permutations are defined by replacing Cipher() with InvCipher() in Eq. 5.1.

The specifications of Cipher(), KeyExpansion(), and InvCipher() are given in Sections 5.1, 5.2, and 5.3, respectively.

5.1 Cipher()#

The rounds in the specification of Cipher() are composed of the following four byte-oriented transformations on the state:

  • SubBytes() applies a substitution table (S-box) to each byte.
  • ShiftRows() shifts rows of the state array by different offsets.
  • MixColumns() mixes the data within each column of the state array.
  • AddRoundKey() combines a round key with the state.

The four transformations are specified in Sections 5.1.1–5.1.4. In those specifications, the transformed bit, byte, or block is denoted by appending the symbol as a superscript on the original variable .

The round keys for AddRoundKey() are generated by KeyExpansion(), which is specified in Section 5.2. In particular, the key schedule is represented as an array of words.

Cipher() is specified in the pseudocode in Alg. 1.

Algorithm 1 Pseudocode for Cipher()

1:

2: See Sec. 3.4

3: See Sec. 5.1.4

4:

5: See Sec. 5.1.1

6: See Sec. 5.1.2

7: See Sec. 5.1.3

8:

9:

10:

11:

12:

13: See Sec. 3.4

14:

The first step (Line 2) is to copy the input into the state array using the conventions from Sec. 3.4. After an initial round key addition (Line 3), the state array is transformed by Nr applications of the round function (Lines 4–12); the final round (Lines 10–12) differs in that the MixColumns() transformation is omitted. The final state is then returned as the output (Line 13), as described in Section 3.4.

5.1.1 SubBytes()#

SubBytes() is an invertible, non-linear transformation of the state in which a substitution table, called an S-box, is applied independently to each byte in the state. The AES S-box is denoted by SBox().

Let denote an input byte to SBox(), and let denote the constant byte . The output byte is constructed by composing the following two transformations:

1. Define an intermediate value , as follows, where is the multiplicative inverse of , as described in Section 4.4:

2. Apply the following affine transformation of the bits of to produce the bits of :

The matrix form of Eq. (5.3) is given by Eq. (5.4) below:

Figure 2 illustrates how SubBytes() transforms the state.

s0,0s0,1s0,2s0,3s1,0s1,1s1,2s1,3s2,0s2,1s2,2s2,3s3,0s3,1s3,2s3,3s′0,0s′0,1s′0,2s′0,3s′1,0s′1,1s′1,2s′1,3s′2,0s′2,1s′2,2s′2,3s′3,0s′3,1s′3,2s′3,3sr,cs′r,cS-Box

Figure 2. Illustration of SubBytes()

The AES S-box is presented in hexadecimal form in Table 4. For example, if , then the substitution value would be determined by the intersection of the row with index ‘5’ and the column with index ‘3’ in Table 4, so that .

Table 4. SBox(): substitution values for the byte xy (in hexadecimal format)

y
0123456789abcdef
x0637c777bf26b6fc53001672bfed7ab76
1ca82c97dfa5947f0add4a2af9ca472c0
2b7fd9326363ff7cc34a5e5f171d83115
304c723c31896059a071280e2eb27b275
409832c1a1b6e5aa0523bd6b329e32f84
553d100ed20fcb15b6acbbe394a4c58cf
6d0efaafb434d338545f9027f503c9fa8
751a3408f929d38f5bcb6da2110fff3d2
8cd0c13ec5f974417c4a77e3d645d1973
960814fdc222a908846eeb814de5e0bdb
ae0323a0a4906245cc2d3ac629195e479
be7c8376d8dd54ea96c56f4ea657aae08
cba78252e1ca6b4c6e8dd741f4bbd8b8a
d703eb5664803f60e613557b986c11d9e
ee1f8981169d98e949b1e87e9ce5528df
f8ca1890dbfe6426841992d0fb054bb16

5.1.2 ShiftRows()#

ShiftRows() is a transformation of the state in which the bytes in the last three rows of the state are cyclically shifted. The number of positions by which the bytes are shifted depends on the row index r, as follows:

ShiftRows() is illustrated in Figure 3. In that representation of the state, the effect is to move each byte by r positions to the left in the row, cycling the left-most r bytes around to the right end of the row. The first row, where , is unchanged.

ShiftRows()sr,0s′r,0sr,1s′r,1sr,2s′r,2sr,3s′r,3ss′s0,0s0,1s0,2s0,3s1,0s1,1s1,2s1,3s2,0s2,1s2,2s2,3s3,0s3,1s3,2s3,3s0,0s0,1s0,2s0,3s1,1s1,2s1,3s1,0s2,2s2,3s2,0s2,1s3,3s3,0s3,1s3,2

Figure 3. Illustration of ShiftRows()

5.1.3 MixColumns()#

MixColumns() is a transformation of the state that multiplies each of the four columns of the state by a single fixed matrix, as described in Section 4.3, with its entries taken from the following word:

Thus,

so that the individual output bytes are defined as follows:

Figure 4 illustrates MixColumns().

s0,0s0,1s0,2s0,3s1,0s1,1s1,2s1,3s2,0s2,1s2,2s2,3s3,0s3,1s3,2s3,3s0,cs1,cs2,cs3,cs′0,0s′0,1s′0,2s′0,3s′1,0s′1,1s′1,2s′1,3s′2,0s′2,1s′2,2s′2,3s′3,0s′3,1s′3,2s′3,3s′0,cs′1,cs′2,cs′3,cMixColumns()

Figure 4. Illustration of MixColumns()

5.1.4 AddRoundKey()#

AddRoundKey() is a transformation of the state in which a round key is combined with the state by applying the bitwise XOR operation. In particular, each round key consists of four words from the key schedule (described in Section 5.2), each of which is combined with a column of the state as follows:

where round is a value in the range , and is the array of key schedule words described in Section 5.2. In the specification of Cipher(), AddRoundKey() is invoked times — once prior to the first application of the round function (see Alg. 1) and once within each of the Nr rounds, when .

The action of this transformation is illustrated in Fig. 5, where . The byte address within words of the key schedule was described in Sec. 3.5.

s0,0s0,1s0,2s0,3s1,0s1,1s1,2s1,3s2,0s2,1s2,2s2,3s3,0s3,1s3,2s3,3s0,cs1,cs2,cs3,c⊕wlwl+2wl+3wl+cl = 4 ∗ rounds′0,0s′0,1s′0,2s′0,3s′1,0s′1,1s′1,2s′1,3s′2,0s′2,1s′2,2s′2,3s′3,0s′3,1s′3,2s′3,3s′0,cs′1,cs′2,cs′3,c

Figure 5. Illustration of AddRoundKey()

5.2 KeyExpansion()#

KeyExpansion() is a routine that is applied to the key to generate words. Thus, four words are generated for each of the applications of AddRoundKey() within the specification of Cipher(), as described in Section 5.1.4. The output of the routine consists of a linear array of words, denoted by , where is in the range .

KeyExpansion() invokes 10 fixed words denoted by for . These 10 words are called the round constants. For AES-128, a distinct round constant is called in the generation of each of the 10 round keys. For AES-192 and AES-256, the key expansion routine calls the first eight and seven of these same constants, respectively. The values of are given in hexadecimal notation in Table 5:

Table 5. Round constants

jRcon[j]jRcon[j]
1[01,00,00,00]6[20,00,00,00]
2[02,00,00,00]7[40,00,00,00]
3[04,00,00,00]8[80,00,00,00]
4[08,00,00,00]9[1b,00,00,00]
5[10,00,00,00]10[36,00,00,00]

The value of the left-most byte of in polynomial form is . Note that for , these bytes may be generated by successively applying xTimes() to the byte represented by (see Eq. 4.5).

Two transformations on words are called within KeyExpansion(): RotWord() and SubWord(). Given an input word represented as a sequence of four bytes,

and

The expansion of the key proceeds according to the pseudocode in Alg. 2. The first Nk words of the expanded key are the key itself. Every subsequent word is generated recursively from the preceding word, , and the word Nk positions earlier, , as follows:

  • If is a multiple of Nk, then .
  • For AES-256, if is a multiple of 8, then .
  • For all other cases, .

Algorithm 2 Pseudocode for KeyExpansion()

1:

2:

3:

4:

5:

6: When the loop concludes, .

7:

8:

9:

10:

11:

12:

13:

14:

15:

16:

17:

18:

  1. 1
    Informally, these functions are sometimes called “encryption” and “decryption,” but neutral terminology is appropriate because there are other applications of block ciphers besides encryption. ↑