1/81
Looks like no tags are added yet.
What does a block cipher operate on?
Fixed-size blocks of data (e.g., 128-bit for AES)
Encryption formula for block ciphers?
C = E(K, P)
Decryption formula?
P = D(K, C)
Examples of block cipher algorithms?
AES/Rijndael, DES, Blowfish.
What is a pseudorandom permutation (PRP)
A block cipher that looks random unless you know the key.
AES block size?
128 bits.
DES block size?
64 bits.
Why is a small block size dangerous?
Vulnerable to codebook attacks due to limited output space.
How many ciphertexts exist for a 16-bit block?
2¹⁶ = 65,536.
What is a round?
A repeated sequence of substitution/permutation operations
What generates round keys?
Key Schedule
What attack happens if all rounds use identical round keys?
Slide attack.
What does an S-Box do?
Substitution (changes bits completely).
What does a P-Box do?
Permutation (reorders bits).
What is the goal of SPN?
Confusion + diffusion.
Which AES mode repeats patterns & is weak?
ECB
Which AES mode chains blocks using XOR of previous ciphertext?
CBC
Which mode makes AES behave like a stream cipher?
CTR mode.
What prevents identical plaintext blocks in CBC?
IV (Initial Value).
How do stream ciphers encrypt?
XOR plaintext with keystream.
What generates the keystream?
Stream cipher algorithm using key + nonce.
Are stream ciphers symmetric or asymmetric?
Symmetric.
Example of insecure historical stream cipher?
A5/1, RC4 (broken).
Example of secure modern stream cipher?
Salsa20, Grain-128a.
Which key/nonce combos are safe to reuse?
Same key + different nonce - safe
Different key + same nonce -safe
Different key + different nonce -safe
NEVER: same key + same nonce (OTP-like reuse vulnerability)
What is an LFSR?
Linear feedback shift register.
Maximal LFSR period?
2ⁿ − 1.
What makes an LFSR maximal?
Primitive polynomial.
Why are LFSRs cryptographically weak?
Linear → predictable once state is known.
Stateful vs Counter-based — difference?
Stateful - evolving internal state (RC4)
Counter - uses key + nonce + counter, no secret internal state (Salsa20)
What is RC4’s key scheduling algorithm called?
KSA
Why is RC4 broken in WEP?
24-bit nonce too small
Biases in output
Key recovery possible.
What does a hash function output?
Fixed-length digest.
Is hashing reversible?
No — one-way only.
What CIA property does hashing support most?
Integrity
What is preimage resistance?
Hard to find a message that maps to a given hash.
Second-preimage resistance?
Hard to find M₂ with same hash as M₁.
Collision resistance?
Hard to find any two messages hashing to same value.
What phenomenon helps explain collision attacks?
Birthday paradox.
Approx how many inputs needed for 50% collision chance in 256-bit hash?
2¹²⁸ (square root).
What attack uses time-based hashing behavior?
Timing attack
SHA-256 block size?
512 bits.
SHA-512 block size?
1024 bits
What construction does SHA-2 use?
Merkle-Damgård compression.
What construction does SHA-3 use?
Sponge function (Keccak).
What is the purpose of a MAC?
A MAC provides message integrity and authentication by generating a tag using a secret key.
What is the formula for a MAC tag?
T = MAC(K, M)
How does keyed hashing differ from normal hashing?
Hashing is public; keyed hashing uses a secret key to authenticate the message.
What security property must MACs provide?
Unforgeability — an attacker cannot create a valid tag without the key.
What is a known-message attack on MACs?
Attacker passively collects messages + tags.
What is a chosen-message attack?
Attacker chooses messages to obtain valid tags — more powerful.
What is a replay attack?
Re-sending a valid message + tag because MACs lack counters.
How are replay attacks mitigated?
Using numbering or counters/out-of-order protection.
What is a PRF?
PRF(K, M) outputs a pseudorandom value; used in protocols and key derivation.
What is secret-prefix MAC construction?
Hash(K || M) — insecure due to length-extension.
What attack breaks secret-prefix MAC?
Length-extension attack (SHA-256/SHA-512)
What fixes different key lengths in hashing?
Using Hash(L || K || M)
What is secret-suffix MAC construction
Hash(M || K) — protects against length extension.
What is HMAC?
A secure MAC using: Hash((K ⊕ opad) || Hash((K ⊕ ipad) || M)).
Why is HMAC secure?
Double hashing prevents length-extension attacks.
What is CMAC?
Cipher-based MAC using block ciphers like AES
What special keys does CMAC use
K1 and K2 derived from main key K
Does CMAC use an IV?
No — CMAC is deterministic.
What is Poly1305?
A dedicated MAC using universal hashing, extremely fast.
What version of TLS uses Poly1305?
TLS 1.3 (and sometimes 1.2)
What is a timing attack on MACs?
Observing faster/slower responses when bytes match to leak information.
How do you prevent timing attacks?
Use constant-time comparisons.
What does Authenticated Encryption (AE) provide?
Confidentiality + integrity + authentication.
What is AE(K, P)?
(C, T) — ciphertext and authentication tag.
What is the decrypt function AD(K, C, T)?
Returns plaintext P if tag is valid.
What is Encrypt-and-MAC?
Encrypt plaintext & MAC plaintext separately — weakest (leaks info).
What is MAC-then-Encrypt?
MAC plaintext, then encrypt both. Used in TLS ≤ 1.2.
What is Encrypt-then-MAC?
Authenticate ciphertext → strongest method. Used in IPSec
What is an Authenticated Cipher?
Cipher that outputs ciphertext + tag (e.g., AES-GCM)
What is AEAD
Authenticated Encryption with Associated Data.
What is Associated Data (A)?
Non-encrypted data that must be authenticated (headers)
What does AEAD(K, P, A) output?
(C,A,T)
What is the security requirement for AEAD?
Misuse-resistance: should not break completely from nonce reuse
What authenticated cipher is NIST standard?
AES-GCM
What protocol suites use AES-GCM
IPSec, SSH, TLS 1.2 & 1.3
What is a major weakness of AES-GCM
Fragile with repeated nonces - allows tag forgery.
What is OCB mode?
Fast authenticated cipher; simpler than GCM but previously patented.