A scheme that encrypts messages of arbitrary length, built from a block cipher through a mode of operation. Messages and ciphertexts are bit strings of any length, under a key .
On top of a block cipher, the below operations are added to make it a scheme:
- Randomisation
An initialization vector or nonce fed into the first block, so encrypting the same message twice under the same key gives different ciphertexts. Without this, equal plaintexts leak through equal ciphertexts. Authentication modes such as CBC-MAC fix the IV to zero instead. They compute a deterministic tag for verification, so randomisation would work against the goal rather than for it. - Padding
Extra bytes appended to the last block so the message length is a multiple of . - Chaining
Each block’s encryption depends on previous blocks, so a repeated plaintext block does not produce a repeated ciphertext block.
Attack Models
An attack model fixes what the attacker is allowed to do. The attacker never sees the key and instead interacts through an oracle.
An oracle is a black box that applies or to inputs the attacker chooses and returns the output, without revealing . Real systems act as oracles. There are 2 types of oracles.
- Encryption oracle
A server that encrypts given messages. - Decryption oracle
A server that decrypts incoming messages except the challenged ciphertext.
Listed from the weakest attacker capability to the strongest. A scheme secure against a stronger model is also secure against the weaker ones.
Ciphertext Only
Attacker has only and searches the key space exhaustively for a giving a meaningful . Requires to make this infeasible.
Examples:
- Secure
One-time pad. AES under a random 128-bit key. - Not secure
Shift, substitution, and Vigenère ciphers, all broken by frequency analysis.
Known Plaintext
Attacker holds ciphertexts together with their exact plaintexts from past traffic, but cannot choose which messages are encrypted. Using the pairs , the attacker tries to learn about the key .
Examples:
- Secure
One-time pad. AES under a random 128-bit key. - Not secure
Shift, substitution, and Vigenère ciphers. ECB mode, where known pairs build a partial codebook.
Chosen Plaintext
Attacker queries an encryption oracle on arbitrary plaintext repeatedly (with or without a bound). By using the plaintext-ciphertext pairs , the attacker tries to learn about the key .
If the attacker cannot learn about , then the scheme is said to be indistinguishable under chosen plaintext attack (IND-CPA).
For a public-key scheme the encryption oracle adds nothing, since the attacker knows the public key and can encrypt any plaintext themselves.
Security is then tested with a game:
- The attacker picks two equal-length messages and sends both to the challenger.
- The challenger picks a random bit , keeps it secret, and returns the challenge ciphertext .
- The attacker keeps querying the encryption oracle on any plaintext, then outputs a guess for .
The attacker wins if with probability noticeably above .
Examples:
- Secure
AES in CBC or CTR mode with a random IV or nonce. El Gamal. RSA-OAEP. - Not secure
Any deterministic scheme, since equal plaintexts give equal ciphertexts. Caesar cipher, one-time pad under a fixed key, ECB mode, textbook RSA.
Chosen Ciphertext
Attacker queries an encryption oracle and decryption oracle on arbitrary plaintext and ciphertext repeatedly (with or without a bound). By using the plaintext-ciphertext pairs , the attacker tries to learn about the key .
If the attacker cannot learn about , then the scheme is said to be indistinguishable under chosen ciphertext attack (IND-CCA).
Same as IND-CPA, plus a decryption oracle that returns for any ciphertext except . Same winning condition on .
The two variants differ by when the decryption oracle is available.
CCA1
Non-adaptive chosen ciphertext attack. Also called a lunchtime attack.
- The attacker queries the decryption oracle only before receiving the challenge ciphertext .
- After is issued, the decryption oracle is withdrawn.
- Models brief unattended access to a decrypting device.
Examples:
- Secure
El Gamal. Cramer-Shoup. AES-GCM and other authenticated encryption. - Not secure
Textbook RSA and ECB mode, where early decryption queries build a codebook that the deterministic challenge then matches against.
CCA2
Adaptive chosen ciphertext attack.
- The attacker queries the decryption oracle both before and after receiving .
- Queries after may be chosen adaptively, based on the answers to earlier decryption queries.
- Every ciphertext except may be submitted, including ones derived from .
- A scheme that is IND-CCA2 secure is also IND-CCA1 secure.
Examples:
- Secure
Cramer-Shoup. RSA-OAEP. Encrypt-then-MAC and AES-GCM. - Not secure
El Gamal, unpadded CBC mode, RSA with PKCS#1 v1.5 padding, all malleable.
El Gamal is a scheme that is IND-CCA1 secure but not IND-CCA2 secure. Given , the attacker submits to the decryption oracle and halves the result to recover .