Counter mode turns AES into a stream-like encryption method. AES encrypts a unique nonce joined to a counter, producing a keystream that is XORed with plaintext. section 4.5.2
The construction works in a few practical steps:
- Choose a nonce that does not repeat; it need not be unpredictable. section 4.5.2
- Concatenate the nonce with a counter beginning at 1, then encrypt each block with AES. section 4.5.2
- XOR the resulting keystream with plaintext; truncate excess keystream so padding is unnecessary. section 4.5.2
- Never reuse a nonce: repeated keystreams let an observer XOR ciphertexts and recover the XOR of the plaintexts. section 4.5.2
A typical AES-CTR layout
AES-CTR uses a 96-bit nonce and a 32-bit counter inside each 16-byte AES block. The counter increments for each block and permits less than 69 GB with one nonce. section 4.5.2

