Cheat Sheet
One dense page for last-minute revision across the whole crypto course.
Public Key Cryptography - ComputerphileComputerphile · public-key cryptography in plain words, 6 min
Elliptic Curves - ComputerphileComputerphile · what elliptic curves are and why crypto uses them, 9 min
AES Rijndael Cipher explained as a Flash animationAppliedGo · AES round animation for quick revision, 4 minFoundationsSearch on YouTube
Security modelSearch on YouTube
| Item | One line |
|---|---|
| Security dimensions | Security attack (action), security mechanism (detect, prevent, recover), security service (counters attacks) |
| Passive attacks | Eavesdropping, traffic analysis — read, no change |
| Active attacks | Masquerade, replay, modification of messages, denial of service |
| Five security services | Authentication (peer entity / data origin), Access control, Confidentiality, Integrity, Non-repudiation — AACIN |
| Specific mechanisms | Encipherment, digital signature, access control, data integrity, authentication exchange, traffic padding, routing control, notarization |
| Network model, 4 tasks | Design algorithm, generate key material, distribute and share the secrets, specify the protocol |
Classical ciphersSearch on YouTube
| Cipher | Rule to remember |
|---|---|
| Caesar | Replace each letter 3 places down: |
| Monoalphabetic | Any permutation; key space ; broken by frequency analysis |
| Playfair | 5x5 keyword matrix, I/J share a cell, encrypt a digram at a time. Rules: filler X for repeats, same row → right, same column → below, else rectangle corners |
| Vigenère | with the keyword repeated; key length hides it imperfectly (repeated patterns leak) |
| Autokey | Key = keyword prefixed to the plaintext (Vigenère's idea); still period-1 frequencies once the key becomes plaintext |
| One-time pad | , truly random as long as , used once. Unbreakable; unusable because of key distribution |
| Rail fence | Write diagonally on r rails, read off row by row |
| Row transposition | Key = column order; read the matrix column by column. Transposition keeps the letter frequencies |
| Product / rotor | Multiple stages (confusion + diffusion); rotor machines rotate wirings every key press |
Symmetric ciphersSearch on YouTube
S-DES and DESSearch on YouTube
| s-DES | DES | |
|---|---|---|
| Block | 8-bit plaintext | 64-bit |
| Key | 10-bit key | 64-bit key carrying 8 parity bits, real key 56 bits () |
| Subkeys | Two 8-bit: P10, split 5+5, LS-1, P8 = ; LS-2, P8 = | 16 x 48-bit: PC-1 (56 bits), shifts in halves, PC-2 (48 bits) |
| Pipeline | IP, , SW, , IP | IP, 16 Feistel rounds, 32-bit swap, IP |
| ; F = E/P (4→8), XOR subkey, S0+S1 (4→2 each), P4 | Round function on Li,Ri: expansion E (32→48), XOR , 8 S-boxes (6→4 each, 32 bits), permutation P | |
| Decryption | Same functions, same order, keys swapped | Same pipeline with reversed |
S-box rule both scales: leading and trailing bit give the row, the middle two give the column.
AES layersSearch on YouTube
| Item | One line |
|---|---|
| Parameters | 128-bit block (4x4 byte state), keys 128/192/256, rounds 10/12/14 (key 10 words, round key expands) |
| Round (nr-1 times) | SubBytes → ShiftRows → MixColumns → AddRoundKey |
| Final round | SubBytes → ShiftRows → AddRoundKey (no MixColumns) |
| SubBytes | S-box: multiplicative inverse in GF , then affine transform; byte-wise confusion |
| ShiftRows | Row r rotates left r bytes |
| MixColumns | Column mixes; diffusion over 4 bytes |
| AddRoundKey | XOR the round key; the only layer that uses the key |
| Decryption | Invert each layer (InvSubBytes, InvShiftRows, InvMixColumns), key schedule reversed |
GF(2^8) arithmeticSearch on YouTube
- GF = bytes with irreducible polynomial =
0x11B; arithmetic is polynomial mod , addition and subtraction are both XOR. - Multiply by 02 (xtime): shift left; if the MSB was 1, XOR with
0x1b. - Examples: (MSB 0, shift only). (MSB 1: ). .
- MixColumns per column, with input :
Matrix is circulant with the row . Multiply by 03 = XOR of xtime (02) and the identity (01).
Modes of operationSearch on YouTube
| Mode | Formula | Notes |
|---|---|---|
| ECB | Simple, parallel; repeated plaintext blocks give repeated ciphertext blocks; do not use for long messages | |
| CBC | , | Chained; needs full blocks; sequential; error hits 2 blocks |
| CFB | , | Stream mode (s bits); uses only the encryption function; errors spread over several blocks |
| OFB | , ; | Keystream independent of the message; bit errors stay put; never reuse the IV |
| CTR | ; | Parallel, random access, preprocessing for both O and C |
Hooks: Every Code Breaker Crashes One Counter (mode order). Errors: ECB one, CBC two, CFB several, OFB/CTR clean.
Public-key ciphersSearch on YouTube
RSA, DH and ECCSearch on YouTube
| Item | Formula |
|---|---|
| RSA setup | , , with , |
| RSA encrypt / decrypt | ; ; keys , |
| RSA check | (Euler: ) |
| DH setup | Public: prime , primitive root . Private: . Public key: |
| DH shared key | |
| DH example | , , , : , , |
| ECC setup | Curve , point of order ; private , public |
| ECC DH | |
| ECC encrypt | ; decrypt: subtract |
| ECC sizes | ECC = symmetric key x2 = RSA modulus x2: 112/160/224/256/384/512 ↔ 512/1024/2048/3072/7680/15360 |
RSA attacks: brute force, mathematical (factor / find / find ), timing (defences: constant time, random delays, blinding), chosen ciphertext (OAEP).
Integrity and signaturesSearch on YouTube
Hash and SHA-1Search on YouTube
| Item | One line |
|---|---|
| 6 properties | Any input size; fixed output; fast; one-way; weak collision (given , no with ); strong collision (no pair at all). 1-5 weak, 1-6 strong |
| Uses | MIC, MAC (keyed hash), signatures, passwords, integrity anchors |
| Birthday attack | Find a pair with equal hashes; effort for an -bit digest. SHA-1 160 bits → ; brute force preimage |
| SHA-1 padding | Pad with 1 bit + zeros to length , append 64-bit length, message is a multiple of 512 bits |
| SHA-1 buffer | , , , , |
| SHA-1 rounds | 4 rounds x 20 steps; : 5A827999 / 6ED9EBA1 / 8F1BBCDC / CA62C1D6 |
| Round functions | , , , |
| Output | , ; SHA-1 160-bit digest, phased out after 2005 |
DSASearch on YouTube
| Group | Formula |
|---|---|
| Global | = 160-bit prime, prime with , = 512..1024 multiple of 64, and |
| Generator | |
| Keys | private; public |
| Sign (random , , use once) | ; ; signature , 320 bits total |
| Verify | ; ; ; ; accept iff |
Same-key-two-signatures reveals : never reuse (ElGamal behaves the same).
HMACSearch on YouTube
ipad = 3636..., opad = 5C5C..., key padded to the block size. Two-pass order: inner with ipad, outer with opad. Design objectives: use existing hash functions, cheap, easy to swap, keep performance, simple, sound interaction mechanics with hash behaviour.
Keys and authenticationSearch on YouTube
Key managementSearch on YouTube
| Item | One line |
|---|---|
| Hierarchy | Master key (KDC only) → session key per connection |
| Symmetric via KDC | One master per party; KDC issues session keys; nonce + timestamps stop replays |
| Public-key distribution | Announcement, publicly available directory, public-key authority, public-key certificates |
| Certificate | Binds subject to public key, signed by CA; CA-only modification, anyone reads it |
| X.509 fields | V, SN, AI, issuer X.500 name, TA (validity period), subject X.500 name, subject public-key info, issuer/subject unique ID (v2+), extensions (v3), signature |
| Chain | CAs form a hierarchy: forward certificates to clients, backward to parents. User checks the issuer's certificate with a higher CA until a trusted one |
| Revocation | CRL: compromised key, no longer certified by CA, CA certificate compromised |
User authenticationSearch on YouTube
| Item | One line |
|---|---|
| Means K-P-I-D | Knows (password, PIN), Possesses (token, smartcard), Is (static biometrics: fingerprint, retina), Does (dynamic: voice, signature). Combine card + PIN; all have issues |
| Replay defences | Sequence numbers (impractical), timestamps (need synced clocks), challenge/response nonce (number used once, ) |
| One-way (email) | Header stays clear, body protected and sender authenticated inside the message |
| Needham-Schroeder | KDC exchange with nonces , ; flaw: a replayed old ticket with a compromised session key is accepted. Fix: add timestamps (Denning) |
Kerberos v4Search on YouTube
Kerberos v4 uses DES and symmetric keys only. The exchange has four steps:
- : (once per logon).
- : — comes from the password.
- : (once per service type); Authenticator carries against replays.
- : ; for mutual authentication : .
Network securitySearch on YouTube
PGP message formatSearch on YouTube
Outer chain: ZIP → E(K_s) → R64 (radix-64 armour). Three content components, learn K-Sig-M:
| Component | Fields |
|---|---|
| Session key component | Key ID of recipient's ; session key , both inside |
| Signature | Timestamp; Key ID of sender's ; leading two octets of the digest; message digest, inside |
| Message | Filename; timestamp; data (compressed by ZIP, encrypted by ) |
SSL/TLSSearch on YouTube
| Thing | One line |
|---|---|
| Architecture | Record protocol (confidentiality + integrity) under handshake, change cipher spec, alert, heartbeat |
| Record format | Content type, major, minor, compressed length (8/8/8/16 bits); fragment B; MAC 0/16/20 B via HMAC; total |
| Handshake, 4 phases | 1: client_hello / server_hello (version, session ID, cipher suite, compression, randoms). 2: certificate, server_key_exchange, certificate_request, server_hello_done. 3: certificate, client_key_exchange, certificate_verify. 4: change_cipher_spec + finished both ways |
| Change cipher spec | 1 message, 1 byte, value 1: pending state → current state |
| Alert | 2 bytes: level (warning 1, fatal 2) + code. Fatal kills the connection |
| Master secret | 48 bytes: PRF(pre_master_secret, "master secret", ClientHello.random ServerHello.random); pre_master via RSA (48 B encrypted with server PU) or DH |
| Heartbeat | heartbeat_request / response, set at Phase 1; proves liveness, keeps firewalls from idling out |
| TLS versions | SSL 2.0 1995, SSL 3.0 1996, TLS 1.0 RFC 2246 1999, 1.1 RFC 4346 2006, 1.2 RFC 5246 2008, 1.3 RFC 8446 2018 |
IPSecSearch on YouTube
| Item | One line |
|---|---|
| RFCs | 4301 architecture, 4302 AH, 4303 ESP, 4306 IKEv2 |
| Services | Access control, connectionless integrity, data origin authentication, replay rejection, confidentiality, limited traffic flow confidentiality |
| Mode compare | Transport: payload protection, host-to-host, outer IP header visible. Tunnel: whole packet encrypted under a new IP header, VPNs, gateways |
| SA | Logical one-way connection: algorithms, keys, lifetime; identified by SPI + IP destination + security protocol identifier; stored in the SAD |
| ESP layout | SPI, seq no, IV (optional), payload, TFC padding, padding 0-255, pad length, next header — encrypted; ICV after encryption, not encrypted |
| AH vs ESP | AH authenticates all but mutable IP fields, no encryption (protocol 51); ESP encrypts + optional auth (protocol 50) |
| Anti-replay | Seq counter from 0, +1 per packet, limit ; receiver window |
| Bundles | Transport adjacency or iterated tunneling; ESP+auth, inner ESP + outer AH, inner transport + outer ESP |
| IKEv2 | Negotiate SA parameters, authenticate endpoints, derive keys, rekey before lifetimes expire |
- Model: attacks → mechanisms → services (AACIN); the network model needs algorithm, keys, distribution, protocol.
- Classical: substitution ciphers die to frequency analysis (Caesar, Playfair, Vigenère, autokey), OTP is unbreakable, transposition keeps frequencies, product ciphers stack confusion and diffusion.
- s-DES: 8/10 bits, P10-LS1-P8 then LS2-P8, with E/P, S0/S1, P4. DES: 64-bit block, 56-bit key, 16 Feistel rounds with 48-bit subkeys, S-boxes 6→4. AES: 128-bit state, 10/12/14 rounds, SubBytes-ShiftRows-MixColumns-AddRoundKey, final round without MixColumns, GF arithmetic mod
0x11Band xtime with0x1b. - Modes: ECB, CBC, CFB, OFB, CTR — formulas above, error behaviour and parallelism hooks.
- Asymmetric: RSA over factoring; DH ( example lands ); ECC point arithmetic, , far smaller keys.
- Signatures and integrity: hash 6 properties, SHA-1 4x20 steps with fixed and magic buffer; DSA with ; HMAC double-hash with ipad/opad.
- Distribution and users: key hierarchy, X.509 fields and CA chains with CRLs, K-P-I-D authentication. Kerberos AS/TGS/V four steps with tickets and authenticators. PGP K-Sig-M inside R64.
- Network security: TLS record + 4-phase handshake + 48-byte master secret through the PRF. IPSec AH (51, integrity only) vs ESP (50, encryption), transport/tunnel modes. SPI+destination+protocol SAs, replay ceiling, IKEv2 keys.