15 — Revision

Common Exam Questions + Answers

The ten most-asked comparisons — each with 10 differences and 10 exam key points. Learn the tables, quote the one-liners.

Q1 · RBAC vs ABAC

#AspectRBACABAC
1Decision basisUser's role onlyAttributes of subject, object, action, environment
2Decision timeAt role-assignment time (static)At request time (dynamic evaluation)
3Context awarenessNone — same role always same accessTime, location, device posture factored in
4GranularityCoarse (whole role)Fine-grained (single attribute combinations)
5Scalability problemRole explosion when rules get fine-grainedAvoids it — policies compose via Boolean logic
6Audit questionEasy: "who has role X?"Hard: must simulate policies over attribute space
7Policy languageRole→permission matrixXACML / Rego / Cedar attribute expressions
8Change handlingRe-assign roles manuallyAutomatic — attribute change flips decisions instantly
9Example"Editors can publish""Doctors read own-dept records, weekdays 07–19"
10RelationRBAC is a special case of ABAC where the only attribute is "role"
  1. RBAC = user → role → permission; ABAC = policy(subject, object, env, action).
  2. ABAC's four sources: subject, object, action, environment.
  3. XACML flow: PEP intercepts, PIP supplies attributes, PDP decides, PAP manages.
  4. PDP verdicts: Permit / Deny / NotApplicable / Indeterminate — fail closed.
  5. Combining: deny-overrides is the safe default.
  6. RBAC audits easily; ABAC needs policy simulation to answer "who can access X".
  7. ABAC is dynamic — no stale role assignments.
  8. Context examples: business hours, managed device, external network.
  9. Role explosion is the classic RBAC failure at scale.
  10. Exam line: roles say who you are, attributes say everything about the request.

Q2 · MAC (Mandatory) vs DAC (Discretionary)

#AspectMACDAC
1Who decidesThe system (central policy)The resource owner
2BasisLabels: clearance vs classificationIdentity + ACL entries
3Formal modelBell–LaPadula (no-read-up, no-write-down)Access matrix / ACLs, no lattice
4Trojan-horse resistanceStrong — malware can't relabelWeak — malware inherits owner's rights
5FlexibilityRigid, users can't overrideFlexible, owner grants at will
6Admin overheadHigh (label everything, clear everyone)Low (owners self-manage)
7Commercial fitPoor — built for military secrecyGood — matches files, sharing, collaboration
8Granting rightsOnly security admin via clearanceOwner can delegate further (leakage risk)
9ExamplesSELinux enforcing, military Top Secret systemsUnix rwx bits, Google-Docs "share" button
10Info flowUp-only lattice (Secret → Top Secret)Any direction the owner permits
  1. MAC = system says; DAC = owner says.
  2. BLP rules: no-read-up (confidentiality), no-write-down (no leaks down).
  3. Biba mirrors BLP for integrity; Clark-Wilson adds well-formed transactions.
  4. DAC's fatal flaw: permission leakage via Trojans and delegation chains.
  5. MAC's fatal flaw: rigidity — every object needs a label, every user a clearance.
  6. Labels form a lattice: levels × compartments (e.g. {NATO}).
  7. Unix permissions and ACLs are textbook DAC.
  8. SELinux/AppArmor are textbook MAC on Linux.
  9. Revocation in DAC is hard (copies propagate); in MAC it's central.
  10. Exam line: MAC stops Trojans, DAC serves collaboration — pick by threat model.

Q3 · AES vs DES

#AspectAESDES
1Block size128 bits64 bits (birthday bound at 2³² blocks)
2Key size128 / 192 / 256 bits56 bits effective (8 parity bits)
3Rounds10 / 12 / 14 by key size16 Feistel rounds
4StructureSPN (SubBytes/ShiftRows/MixColumns)Feistel network (F need not invert)
5S-boxesOne 8-bit S-box (inverse + affine)Eight 6→4-bit S-boxes + E-expansion + P-box
6Brute force2¹²⁸ — infeasible2⁵⁶ — broken 1998 (Deep Crack, ~22 h)
7StatusSecure, NIST standard since 2001Withdrawn; 3DES as stopgap, now also retired
8SpeedFast in software + AES-NI hardwareSlower, bit-permutation heavy
9Key scheduleRotWord/SubWord/Rcon, 44/52/60 wordsPC-1 → 16 LS shifts → PC-2, 16×48-bit keys
10Final roundOmits MixColumns (decryption symmetry)Ends with swap + IP⁻¹
  1. AES-128 = 10 rounds; more key bits = more rounds (12/14).
  2. DES's 56-bit key is its death sentence — memorise 2⁵⁶ and Deep Crack 1998.
  3. SPN needs invertible layers; Feistel needs none (XOR trick, p.08).
  4. AES S-box = GF inverse + affine; DES strength = its 8 S-boxes.
  5. 64-bit blocks leak after ~2³² blocks (Sweet32) — second DES killer.
  6. 3DES = EDE with 2–3 keys, 64-bit blocks remain — only a bandage.
  7. FIPS vectors: AES Round-1 → a4 68 6b 02…; DES K₁ → 1B02EFFC7072.
  8. AES-NI makes AES ~10× faster than DES in practice.
  9. Grover halves symmetric strength: AES-128 ≈ 64-bit quantum — prefer AES-256 long-term.
  10. Exam line: DES taught us Feistel; AES replaced everything with SPN + big keys.

Q4 · AES vs DES vs RSA

#AspectAESDESRSA
1FamilySymmetric blockSymmetric blockAsymmetric (public-key)
2Key sizes128/192/256-bit secret56-bit secret2048/3072-bit modulus
3Hard problemNone (brute force only)None (brute force only)Factoring n = pq
4SpeedVery fast (GB/s)Moderate~1000× slower — bulk data impossible
5Key distributionNeeds pre-shared secretSame problemSolves it: publish (e,n), keep d
6Primary useBulk encryption (TLS records)Legacy onlyKey exchange, signatures, certs
7Security statusSecureBrokenSecure at 2048+ (classical)
8Signatures?NoNoYes (swap e/d roles)
9Padding/modesNeeds mode (GCM/CBC) + nonceSame + Sweet32 limitsNeeds OAEP/PSS — textbook RSA broken
10Quantum outlookHalved (Grover) — use 256-bitDead anywayKilled by Shor → migrate to PQC
  1. Symmetric = one secret, fast; asymmetric = keypair, slow but solves distribution.
  2. Real systems are hybrid: RSA/DH move the key, AES moves the data (TLS).
  3. Never compare "56-bit vs 2048-bit" directly — different math, different units.
  4. RSA can sign; no symmetric cipher can (needs MAC/signature layer).
  5. Textbook RSA without OAEP/PSS is insecure — always name the padding.
  6. DES is the "broken" answer to any "which is secure" question.
  7. Factoring is sub-exponential; AES brute force is fully exponential.
  8. Shor breaks RSA/DH/ECC; Grover only halves AES — know which is which.
  9. 2048-bit RSA ≈ 112-bit symmetric strength (NIST equivalence).
  10. Exam line: AES encrypts fast, RSA distributes keys and signs, DES is history.

Q5 · RSA vs Diffie-Hellman

#AspectRSADiffie-Hellman
1PurposeEncryption + signaturesKey agreement only — encrypts nothing itself
2Hard problemFactoring n = pqDiscrete log a = log_g A
3What travelsCiphertext c = m^e mod nPublics A = g^a, B = g^b — secret K never sent
4KeysLong-term keypair (e,n)/(d,n)Ephemeral secrets a,b + public params (p,g)
5AuthenticationBuilt-in via certs + signaturesNone — needs STS/signatures (p.11–12)
6Forward secrecyRSA key-transport: no (leaked d opens past traffic)Ephemeral DHE: yes (erase a,b)
7Core equationc = m^e, m = c^d, ed ≡ 1 mod φK = B^a = A^b = g^(ab) mod p
8Worked anchor(3,55)/(27,55), m=14 ↔ c=49p=23,g=5: A=8,B=19,K=2
9Typical useCertificates, signatures, key wrapTLS-DHE/ECDHE session keys
10Quantum fateBroken by ShorBroken by Shor (discrete log too)
  1. DH establishes a key; RSA moves data or signs — different jobs.
  2. DH's security = discrete log; RSA's = factoring — both fall to Shor.
  3. Plain DH is anonymous → MITM gives K₁≠K₂ (p.11); fix with STS (p.12).
  4. Ephemeral DH gives forward secrecy; static RSA transport doesn't.
  5. Signatures belong to RSA (σ = H(m)^d); DH has no signing mode.
  6. Both need parameter hygiene: RSA ≥2048-bit, DH safe primes + validate peer values.
  7. Small-subgroup attacks hit sloppy DH; small-e/no-padding hits sloppy RSA.
  8. Modern TLS uses ECDHE (DH over elliptic curves) + RSA/ECDSA signatures — both together.
  9. Key confirmation in DH comes only via STS/SIGMA-style follow-ups.
  10. Exam line: RSA speaks (encrypts/signs), DH agrees (shared secret, needs a voice = signatures).

Q6 · Monoalphabetic vs Polyalphabetic

#AspectMonoalphabeticPolyalphabetic
1DefinitionOne fixed substitution alphabetMany rotating alphabets (key decides which)
2Same-letter mappingAlways same ciphertext letterVaries with position (A→L here, →X there)
3ExamplesCaesar, simple substitution, (Playfair is digraph-mono)Vigenère, autokey, Enigma rotors
4KeyspaceCaesar 25; substitution 26! ≈ 2⁸⁸26^L for length-L key (grows with key)
5Frequency analysisBreaks directly (~25–50 letters)Flat singles — need key length first
6Breaking methodCount → map E/T/A → digraphs → THEKasiski (repeats→GCD) or Friedman (IC) → L Caesars
7Key-length roleNone (single alphabet)Everything: L unknown = hard, L known = L easy Caesars
8HistoryBroken by Arab scholars ~9th c."Indéchiffrable" 300 yrs, broken 1863 (Kasiski)
9Ciphertext neededTens of lettersHundreds (statistics per sub-alphabet)
10Core lessonBig keyspace ≠ security (26! still falls)Periodicity is the fatal flaw (→ one-time pad needs L = message)
  1. Mono = 1 alphabet; poly = L interleaved Caesars (Vigenère formula p.05).
  2. Doubles/word patterns survive mono; poly smears them.
  3. Kasiski: repeated blocks → distances → GCD ≈ L.
  4. Friedman: IC ≈ 0.066 English vs 0.038 random → estimate L.
  5. Once L is known, attack each of the L columns as Caesar.
  6. Running key as long as the message = one-time pad = unbreakable (if random, single-use).
  7. Playfair raises symbols 26→625 digraphs but stays mono at digraph level.
  8. Enigma = polyalphabetic with huge period — broken via period + crib flaws.
  9. Exam trap: "26! therefore secure" — false, statistics bypass keyspace.
  10. Exam line: mono preserves statistics; poly hides them until the period leaks.

Q7 · Stream Cipher vs Block Cipher

#AspectStream CipherBlock Cipher
1UnitBit/byte at a timeFixed blocks (64/128-bit)
2Core ideaKeystream ⊕ plaintext (like OTP approximation)Rounds of substitution + permutation
3ExamplesChaCha20, Trivium (RC4 retired)AES, DES, 3DES
4PaddingNever neededRequired (except CTR/streaming modes)
5IV / nonceMandatory per message — reuse = catastropheIV per message in CBC/CTR/GCM modes
6Error propagation1 flipped bit = 1 flipped bit (malleable!)1 flipped bit = whole block garbled (CBC/ECB)
7SynchronisationMust stay in sync (lost bit kills stream)Self-syncing per block
8Speed/profileVery fast, tiny hardware, no padding overheadAES-NI very fast; needs mode machinery
9Typical usesTLS ChaCha20, mobile, real-time mediaDisk, TLS-AES-GCM, general encryption
10Classic failureNonce/keystream reuse (two-time pad)ECB penguin — equal blocks show patterns
  1. Stream = OTP with pseudorandom keystream; security lives in keystream + nonce discipline.
  2. Never reuse (key, nonce) in a stream cipher — XOR of two ciphertexts kills both.
  3. Block ciphers need modes: ECB (never), CBC (needs MAC), CTR/GCM (modern).
  4. AEAD (AES-GCM, ChaCha20-Poly1305) adds integrity — raw stream/block gives none.
  5. Malleability: flipping ciphertext bits flips plaintext bits predictably in streams/CTR.
  6. Block-cipher modes turn blocks into streams (CTR) or chains (CBC).
  7. RC4/WEP is the canonical stream-cipher failure (biased keystream + IV reuse).
  8. ChaCha20-Poly1305 is the modern stream answer (TLS 1.3).
  9. Disk encryption uses wide-block modes (XTS), not raw ECB.
  10. Exam line: streams need nonces, blocks need modes — both need authentication.

Q8 · Symmetric vs Asymmetric Encryption

#AspectSymmetricAsymmetric
1KeysOne shared secretPublic + private pair
2SpeedFast (GB/s with AES-NI)~1000× slower (big-number math)
3Key distributionHard — secret must pre-exist (n² keys for n users)Easy — publish public key
4Key sizes128–256-bit secret2048-bit+ (different security units)
5ExamplesAES, ChaCha20, DES (dead)RSA, DH, ECDH, ECDSA
6AuthenticationNo (MAC needed on top)Yes — signatures + certs
7Non-repudiationImpossible (both holders can forge MACs)Possible (only private holder signs)
8Scalingn users need ~n²/2 pairwise keysn keypairs + directory of publics
9Real-world useBulk data (TLS records, disk)Handshake, signatures, PKI
10Quantum impactHalved strength (Grover)Broken (Shor) — PQC migration
  1. One secret vs keypair is the entire distinction — everything follows.
  2. n² scaling is why the internet can't run on symmetric alone.
  3. Hybrid encryption (TLS): asymmetric moves the key, symmetric moves the data.
  4. Kerckhoffs applies to both: secrecy in the key, never the algorithm.
  5. Symmetric + MAC = authenticated; asymmetric + hash = signed.
  6. 2048-bit RSA ≈ 112-bit symmetric — memorise one equivalence row.
  7. Private keys never travel; public keys travel inside certificates.
  8. Key exchange (DH) and encryption (RSA) are different asymmetric jobs.
  9. Post-quantum: Kyber/Dilithium replace RSA/DH/ECC; AES-256 stays.
  10. Exam line: asymmetric distributes trust, symmetric moves bytes.

Q9 · Hash vs MAC vs Digital Signature

#AspectHashMACSignature
1Keyed?NoYes (shared secret)Yes (private signs, public verifies)
2Reversible?NoNoNo (verify-only with public key)
3ProvidesIntegrity detectionIntegrity + authenticityIntegrity + auth + non-repudiation
4Verifier needsNothing (recompute)The shared keySigner's public key/cert
5ExamplesSHA-256, SHA-3, BLAKE2HMAC-SHA256, Poly1305RSA-PSS, ECDSA, Dilithium
6OutputDigest (256-bit)Tag (128–256-bit)Signature (2048-bit RSA / 512-bit ECDSA)
7Repudiation?N/ARepudiable (either key-holder forged it)Non-repudiable (only signer holds d)
8Broken exampleMD5/SHA-1 collisionsCBC-MAC on variable lengths (no length prefix)Textbook RSA w/o PSS, ECDSA nonce reuse
9SpeedFastestFast (2 hashes)Slow (modular exponentiation)
10Use when…Checksums, commitments, Merkle treesTwo parties share a key (TLS records)Public verifiability / legal proof needed
  1. Hash detects change; MAC proves a key-holder sent it; signature proves which one.
  2. HMAC = H((K⊕opad) ‖ H((K⊕ipad) ‖ m)) — two nested hashes.
  3. Birthday bound: n-bit hash = 2^(n/2) collision effort (p.02).
  4. Sign-then-hash flow: σ = Sign(H(m)), verify H(m) ≟ Verify(σ).
  5. Anyone can hash — so hashes alone never authenticate.
  6. ECDSA leaks d if the per-signature nonce repeats or is biased (PS3 hack).
  7. Certificates = CA's signature over (identity, public key).
  8. TLS 1.3 uses HMAC-style HKDF + signatures for handshake auth.
  9. Password storage wants slow salted hashes (bcrypt/Argon2), not SHA-256.
  10. Exam line: unkeyed → keyed-shared → keyed-public = hash → MAC → signature.

Q10 · Substitution vs Transposition (Classical)

#AspectSubstitutionTransposition
1What changesLetters (A→Q)Positions (read order shuffled)
2Letter multisetChanged (E becomes S)Preserved — same letters, new order
3Frequency profileMapped but intact (breakable)Identical counts — frequencies useless
4ExamplesCaesar, monoalphabetic, Vigenère, PlayfairRail fence, columnar, route ciphers
5Key formAlphabet permutation / keyword shiftsPermutation of positions / column order
6Keyspace26! (mono) / 26^L (Vigenère)w! for width-w columnar (small!)
7AttackFrequency analysis (mono) / Kasiski (poly)Anagramming + digraph-position stats
8Digraph fateTH→?? (mapped pairs)TH split apart but both survive
9Modern descendantS-boxes (SubBytes, DES S-boxes)P-boxes (ShiftRows, DES-P, IP)
10CombinedProduct ciphers alternate both: DES/AES = substitution + transposition × rounds (confusion + diffusion)
  1. Substitution confuses what; transposition diffuses where — Shannon's pair.
  2. Rail fence: zigzag rows then read rows; columnar: write rows, read columns by key order.
  3. Transposition preserves multiset — frequency counting fails, anagramming wins.
  4. Columnar with width w has only w! keys — tiny vs 26!.
  5. Double columnar was field-grade (WWI–WWII) — product of two transpositions.
  6. Playfair substitutes digraphs (625 symbols) — still substitution family.
  7. DES/AES round = S-box (substitution) + permutation (transposition) — classical ideas, modern math.
  8. Homophonic substitution (many→one symbols) flattens frequencies — bridge between families.
  9. ECB-mode pattern leak is a transposition-style failure (positions leak).
  10. Exam line: substitute to confuse, transpose to diffuse, iterate both to be secure.
How to use this page in the exam: for any "compare X vs Y" question, write the 10-row table first (marks for structure), then 3–4 key points as sentences. The one-liners at each table's row 10 / list end are your closing lines.
← Prev
14 · ABAC
Next →
Home