CTR mode
Counter mode: a way of using a block cipher that encrypts a running counter to make keystream, then combines that with the message using XOR.
In more detail
CTR mode turns a block cipher such as AES into a stream cipher, so blocks can be processed in parallel and no padding is needed. It keeps data secret but offers no integrity, so flipping a bit of the ciphertext flips the same bit of the plaintext without anyone noticing. The nonce and counter must never repeat under one key, and GCM is CTR mode with an authentication tag added.
Examples
cmd = ["openssl", "enc", "-aes-256-ctr", "-K", KEY, "-iv", IV]bank reads: pay 9100.00 GBP to 12345678Related terms
- keystream — A stream of random-looking bytes made from a key and a nonce, which a stream cipher combines with the message using XOR to encrypt it.
- bit-flipping attack — An attack that changes chosen bits of encrypted data so that, after decryption, the message says something different, without the attacker knowing the key.
- AES-GCM — AES in Galois/Counter Mode: the most widely used way to encrypt data so that it stays secret and any tampering is detected.
- XOR — Exclusive or: a bit operation that outputs 1 when two bits differ and 0 when they match.
Taught in
- Symmetric Encryption: AES-GCM & ChaCha20 — Cybersecurity Fundamentals, GRC & Cryptography