Si102x/3x
14.6.5. Counter Mode
The Counter (CTR) Mode uses a sequential counter which is incremented after each block. This turns the
block cipher into a stream cipher. This algorithm is shown inFigure 14.4. Note that the decryption operation
actually uses the encryption key and encryption block cipher. The XOR operation is always on the output
of the cipher. The counter is a 16-byte block. Often, several bytes of the counter are initialized to a nonce
(number used once). The last byte of the counter is incremented and propagated. Thus, the counter is
treated as a 16-byte big endian integer.
Encryption
Counter
(0x00...00)
Counter
(0x00...01)
Encryption Key
Encryption
Cipher
XOR
Encryption Key
Encryption
Cipher
XOR
Plaintext
Plaintext
Ciphertext
Ciphertext
Decryption
Encryption
Key
Ciphertext
Counter
(0x00...00)
Counter
(0x00...01)
Encryption
Cipher
XOR
Encryption
Key
Ciphertext
Encryption
Cipher
XOR
Plaintext
Plaintext
Figure 14.7. Counter Mode
Rev. 0.3
199