How unit 3 is examined
This unit covers authentication, hashing, signatures and Kerberos; SHA-512 and DSS carry the most marks, then Kerberos, then MD5, hash-function comparison, message authentication and public-key distribution.
Message Authentication
Low weight
Definition. Message authentication is the procedure that lets the receiver verify that a received message is genuine, unaltered, in the right sequence and from the claimed sender.
Key points.
- Disclosure is release of message contents to someone who does not hold the key, and it is countered by encryption.
- Traffic analysis is discovering the pattern of traffic, such as frequency and length of messages between parties.
- Masquerade is insertion of messages from a fraudulent source, and content modification is changing the contents of a message.
- Sequence modification is inserting, deleting or reordering messages, and timing modification is delaying or replaying messages.
- Source repudiation (sender denies sending) and destination repudiation (receiver denies receiving) are countered only by a digital signature.
- Lower level: an authentication function (message encryption, MAC or hash) produces an authenticator, a value used to authenticate the message.
- Higher level: an authentication protocol uses that function so the receiver can verify the message is authentic.
- A MAC, $MAC = C_K(M)$, gives authentication with a shared secret key, while a digital signature adds non-repudiation.
Answer frame. Open with the definition; list the six attacks one line each; then explain the two levels; close with the MAC versus digital signature link.
Asked: [7 marks] (Nov 2023) What are the types of attacks addressed by message authentication? What are the two levels of functionality that comprise a message authentication or digital signature mechanism?
Digital Signature
Not asked since 2022
Definition. A digital signature is a value computed from the message and the signer's private key, which anyone can verify with the signer's public key.
Key points.
- It gives authentication, message integrity and non-repudiation, which a MAC cannot give because the key is shared.
- In RSA signing, $S = H(M)^d \bmod n$ and verification checks $S^e \bmod n = H(M)$.
- The signature depends on the message, so it cannot be moved to another document.
- Direct signatures involve only sender and receiver, while arbitrated signatures use a trusted third party.
Key Management
Low weight
Definition. Key management is the generation, distribution, storage and replacement of cryptographic keys; public-key management mainly means distributing public keys so that they can be trusted.
Key points.
- Public announcement: users broadcast their public keys, which is simple but anyone can forge such an announcement.
- Publicly available directory: a trusted directory holds name and public key entries, which users register and update securely, but the directory can be tampered with.
- Public-key authority: the authority hands out signed current public keys on request, which is secure but a bottleneck as every user must contact it.
- Public-key certificates: a certificate authority signs the binding of identity and public key, so users exchange certificates without contacting the authority each time.
- The X.509 certificate and PKI carry the owner, public key, validity and the CA signature.
- Security rises and overhead rises in the order announcement, directory, authority, certificates; certificates give the best balance.
Asked: [7 marks] (Nov 2022) Explain in short different method of distribution of public key management.
Key Exchange
Not asked since 2022
Definition. Key exchange (key agreement) lets two parties establish a shared secret over an insecure channel, as in Diffie-Hellman.
Key points.
- Public values are a prime $q$ and a primitive root $\alpha$; A picks secret $X_A$ and sends $Y_A = \alpha^{X_A} \bmod q$, B does likewise.
- Both compute $K = Y_B^{X_A} \bmod q = Y_A^{X_B} \bmod q = \alpha^{X_A X_B} \bmod q$.
- Security rests on the discrete logarithm problem.
- Plain Diffie-Hellman is open to a man-in-the-middle attack unless the values are authenticated.
Hash Function
Low weight
Definition. ==A hash function $H$ maps a message of any length to a fixed-length digest, $h = H(M)$.==
Key points.
- Properties: it accepts any input size, gives fixed output, is easy to compute, is one-way (preimage resistant), and is weak- and strong-collision resistant.
- A hash gives integrity: any change in $M$ changes the digest, so the digest is sent with the message or signed.
- MD5 gives a 128-bit digest and SHA-1 a 160-bit one, so brute-force effort is $2^{64}$ and $2^{80}$ by the birthday bound.
- Example: MD5 of the empty string is d41d8cd98f00b204e9800998ecf8427e, and MD5("abc") is 900150983cd24fb0d6963f7d28e17f72; SHA-1("abc") is a9993e36...d89d.
| Feature | MD5 | SHA (SHA-1 / SHA-512) |
|---|---|---|
| Digest size | 128 bits | 160 bits (SHA-1), 512 bits (SHA-512) |
| Block size | 512 bits | 512 bits (SHA-1), 1024 bits (SHA-512) |
| Steps | 64 (4 rounds of 16) | 80 |
| Word / registers | 32-bit, 4 registers | 32-bit, 5 registers (SHA-1); 64-bit, 8 (SHA-512) |
| Length field | 64 bits | 64 bits (SHA-1), 128 bits (SHA-512) |
| Speed | Faster | Slower |
| Security | Collisions found, broken | SHA-1 collisions found; SHA-2 secure |
Answer frame. Open with the definition and properties; then the comparison table; give the digest examples; close that SHA-2 is preferred over MD5.
Asked: [7 marks] (Dec 2025) Define Hash Function. Differentiate between MD5 and SHA algorithms with suitable examples.
Universal Hashing
Not asked since 2022
Definition. A universal hash family is a set of hash functions such that, for a randomly chosen member $h$, any two distinct keys collide with probability at most $1/m$.
Key points.
- Formally, $\Pr[h(x) = h(y)] \le 1/m$ for all $x \ne y$, where $m$ is the output range.
- A common family is $h_{a,b}(x) = ((ax + b) \bmod p) \bmod m$ with random $a, b$ and prime $p$.
- Random choice defeats an adversary who tries to pick inputs that collide.
- It is used in hash tables and in Wegman-Carter message authentication.
Cryptographic Hash Function
Not asked since 2022
Definition. A cryptographic hash function is a hash function that is one-way and collision resistant, so it is computationally infeasible to invert or to find two inputs with the same digest.
Key points.
- Preimage resistance: given $h$, finding $M$ with $H(M) = h$ is infeasible.
- Second-preimage resistance: given $M_1$, finding $M_2 \ne M_1$ with the same hash is infeasible.
- Collision resistance: finding any pair $M_1 \ne M_2$ with $H(M_1) = H(M_2)$ is infeasible, and the birthday bound makes it cost about $2^{n/2}$.
- It is used for digital signatures, MACs, password storage and integrity checks.
MD (MD5)
Low weight
Definition. MD5 is a hash algorithm that takes a message of any length and produces a 128-bit message digest, processing it in 512-bit blocks.
Key points.
- Padding: append a single 1 bit then 0 bits until the length is 448 mod 512.
- Append length: add the original length as a 64-bit value so the total is a multiple of 512 bits.
- Initialise the 128-bit buffer as four 32-bit registers A = 67452301, B = EFCDAB89, C = 98BADCFE, D = 10325476 (hex).
- Each 512-bit block is processed in four rounds of 16 steps each, 64 steps in total.
- Each round uses a different function of B, C, D: $F = (B \wedge C) \vee (\neg B \wedge D)$, $G = (B \wedge D) \vee (C \wedge \neg D)$, $H = B \oplus C \oplus D$, $I = C \oplus (B \vee \neg D)$.
- Each step uses one 32-bit message word, a constant $T_i$ from the sine table and a left rotation.
- The output of the fourth round is added modulo $2^{32}$ to the block's input registers, and the final ABCD is the 128-bit digest.
Asked: [7 marks] (Nov 2022) What is MD5? Explain MD5 with neat and clean diagram.
Secure Hash Algorithm (SHA)
High weight
Definition. SHA is a family of NIST hash functions built on the Merkle-Damgard iteration; SHA-512 takes a message shorter than $2^{128}$ bits and produces a 512-bit digest.
Steps.
- Append padding: one 1 bit then 0 bits so the length is 896 mod 1024.
- Append length: a 128-bit field holds the original length, making the total a multiple of 1024 bits.
- Initialise the hash buffer with eight 64-bit words $H_0 \ldots H_7$ (a-h), the fractional parts of the square roots of the first eight primes.
- Process each 1024-bit block $M_i$ through the 80-round compression function, which starts from the current buffer.
- Output: after the last block the buffer of eight words is the 512-bit digest.
Compression (per block).
- The block is split into sixteen 64-bit words $W_0 \ldots W_{15}$, and the schedule extends them to 80 words with $W_t = \sigma_1(W_{t-2}) + W_{t-7} + \sigma_0(W_{t-15}) + W_{t-16} \bmod 2^{64}$.
- Working variables a-h are copied from the chaining value and updated in each round $t$ using constant $K_t$ (from cube roots of the first 80 primes).
- Each round computes $T_1 = h + Ch(e,f,g) + \Sigma_1(e) + W_t + K_t$ and $T_2 = \Sigma_0(a) + Maj(a,b,c)$, all modulo $2^{64}$.
- Then the words shift: $h = g$, $g = f$, $f = e$, $e = d + T_1$, $d = c$, $c = b$, $b = a$, $a = T_1 + T_2$.
- After round 80 each working variable is added modulo $2^{64}$ to the input chaining value, and this sum is the input to the next block.
Collision order. Finding two messages with the same digest by the birthday attack takes about $2^{n/2} = 2^{256}$ operations for SHA-512, while finding a message for a given digest takes $2^{512}$.
| Variant | Digest | Block | Word | Max message |
|---|---|---|---|---|
| SHA-1 | 160 | 512 | 32 | $2^{64}$ |
| SHA-256 | 256 | 512 | 32 | $2^{64}$ |
| SHA-384 | 384 | 1024 | 64 | $2^{128}$ |
| SHA-512 | 512 | 1024 | 64 | $2^{128}$ |
Merits and demerits.
- Merits: SHA-2 has no practical attacks, it is a NIST standard, and it is widely used in signatures, certificates and TLS.
- Demerits: SHA-1 and SHA-0 have weaknesses and practical collisions, and SHA-2 is slower than MD5 with 64-bit arithmetic.
- SHA-2 is open to length-extension attacks, which SHA-3 (Keccak) avoids.
Answer frame. For the steps question, open with the definition and draw the diagram; list the five steps, then compression with $W_t$; close with the $2^{256}$ birthday bound. For the compression question, stress schedule, working variables, round functions and final addition. For merit and demerit, give the variants table then the merits and demerits.
Asked: [7 marks] (Dec 2020, Jun 2025) Describe the steps in finding the message digest using SHA-512 algorithm. What is the order of finding two messages having the same message digest? With a neat diagram, explain the steps of SHA producing a 512-bit digest from a message of length less than $2^{128}$ bits. Asked: [7 marks] (Dec 2020) Explain the compression of Secure Hash Algorithm. Asked: [7 marks] (Nov 2022) Explain the Secure Hash Algorithm (SHA) with their Merit and Demerit.
Pitfall: the padding length is 896 mod 1024 with a 128-bit length field; 448 mod 512 and 64 bits belong to MD5 and SHA-1.
Digital Signature Standard (DSS)
High weight
Definition. DSS is the NIST standard (FIPS 186) whose Digital Signature Algorithm (DSA) signs the hash of a message using a private key and verifies it with a public key, based on the discrete logarithm problem.
Global and key parameters.
- $p$ is a prime of 512 to 1024 bits, $q$ is a 160-bit prime divisor of $p-1$, and $g = h^{(p-1)/q} \bmod p$ with $1 < h < p-1$.
- Private key $x$ is random with $0 < x < q$, and public key is $y = g^x \bmod p$.
Signature generation.
- Choose a fresh random $k$ with $0 < k < q$ for each signature.
- Compute $r = (g^k \bmod p) \bmod q$.
- Compute $s = [k^{-1}(H(M) + xr)] \bmod q$; the signature is $(r, s)$.
Verification.
- Compute $w = s^{-1} \bmod q$, then $u_1 = [H(M)\,w] \bmod q$ and $u_2 = (r\,w) \bmod q$.
- Compute $v = [(g^{u_1} y^{u_2}) \bmod p] \bmod q$.
- The signature is valid if $v = r$.
Example. Given $p = 23$, $q = 11$, $g = 4$, $x = 3$, $H(M) = 5$, $k = 7$.
| Step | Working | Value |
|---|---|---|
| $y$ | $4^3 \bmod 23$ | 18 |
| $r$ | $(4^7 \bmod 23) \bmod 11$ | 8 |
| $s$ | $7^{-1}(5 + 3 \cdot 8) \bmod 11 = 8 \cdot 29 \bmod 11$ | 1 |
| $w$ | $1^{-1} \bmod 11$ | 1 |
| $u_1, u_2$ | $5 \cdot 1,\ 8 \cdot 1$ | 5, 8 |
| $v$ | $(4^5 \cdot 18^8 \bmod 23) \bmod 11$ | 8 |
Signature $(8, 1)$ is valid because $v = r = 8$.
Key points.
- The hash (SHA-1 originally) is signed, not the message, so any length is handled and integrity is checked.
- Security rests on the discrete logarithm problem, so recovering $x$ from $y$ is infeasible.
- $k$ must be secret, random and never reused, or $x$ can be computed from the signature.
- Unlike RSA, DSA only signs; it cannot encrypt.
Answer frame. Open by defining DSS/DSA and its parameters; draw the sign and verify block diagram; write generation then verification formulas; close with the hash role and discrete-log security.
Asked: [7 marks] (Dec 2020, Nov 2023, Jun 2025, Dec 2025) Define the generation and verification of the digital signature using DSS algorithm. Describe DSS in detail. What is a digital signature? Explain DSS with block diagram. Illustrate the steps in signature generation and verification functions of DSS.
Cryptanalysis: Time-Memory Trade-off Attack
Not asked since 2022
Definition. A time-memory trade-off (Hellman) attack precomputes tables of encryption chains so that a key is found faster online than by brute force, using less memory than a full table.
Key points.
- Precomputation walks chains $x \to f(x) \to f(f(x))$ and stores only the start and end points.
- Online, the attacker follows the ciphertext along its chain to an end point, then rebuilds the chain from the start to find the key.
- For key space $N$, tables of size $M$ give time $T$ with $TM^2 = N^2$.
- Rainbow tables reduce chain merging, and salting defeats them.
Differential Cryptanalysis
Not asked since 2022
Definition. Differential cryptanalysis (Biham and Shamir) is a chosen-plaintext attack that studies how a chosen difference between two plaintexts propagates to the ciphertext difference.
Key points.
- The attacker picks plaintext pairs with a fixed XOR difference $\Delta P$ and records the ciphertext differences.
- Certain differences appear with high probability, which reveals information about the round subkey.
- It breaks DES with 16 rounds using about $2^{47}$ chosen plaintexts, which is fewer than $2^{55}$ of brute force.
- DES S-boxes were designed to resist it; AES also resists it.
Secure channel and authentication system like Kerberos
Medium weight
Definition. Kerberos is a trusted third-party authentication service that uses symmetric keys and tickets so that a client proves its identity to servers without sending its password over the network.
Servers and their roles.
- The Authentication Server (AS) knows all user passwords, authenticates the user at login and issues a Ticket Granting Ticket (TGT) with session key $K_{c,tgs}$.
- The Ticket Granting Server (TGS) accepts a TGT and an authenticator, and issues a service ticket for the requested server with key $K_{c,v}$.
- The application server $V$ accepts the service ticket and authenticator and offers the service; it shares a secret key with the TGS.
- AS and TGS together form the Key Distribution Center (KDC) of a realm.
Message flow.
- C to AS: $ID_c$, $ID_{tgs}$, $TS_1$.
- AS to C: $E(K_c, [K_{c,tgs}, ID_{tgs}, TS_2, Lifetime, Ticket_{tgs}])$, opened using a key made from the password.
- C to TGS: $ID_v$, $Ticket_{tgs}$, $Authenticator_c$.
- TGS to C: $E(K_{c,tgs}, [K_{c,v}, ID_v, TS_4, Ticket_v])$.
- C to V: $Ticket_v$, $Authenticator_c$.
- V to C: $E(K_{c,v}, [TS_5 + 1])$, which proves the server is genuine.
Inter-realm operation. When client and server sit in different realms, the two TGSs share a secret key, so the client asks its local TGS for a ticket to the remote TGS (a referral ticket), presents it to the remote TGS, and receives a service ticket for the remote server. The local TGS thus acts as a trusted entry to the remote realm, and the client then talks to the remote server as in messages 5-6.
Answer frame. For the servers question, open with the definition, draw the four-party diagram, explain AS, TGS and V in order, then the six messages, and close with timestamps and session keys. For the inter-realm question, draw client, local TGS, remote TGS and remote server, explain the shared key, then the three ticket steps.
Asked: [7 marks] (Dec 2020, Dec 2025) What are the different servers used in Kerberos? Explain the role of each one. Explain Kerberos Authentication System with suitable diagram. Asked: [7 marks] (Jun 2025) Design the role of Ticket Granting Server in inter-realm operations of Kerberos.
Last-minute revision
- MAC: $C_K(M)$, needs a shared key; a digital signature also gives non-repudiation.
- Six attacks: disclosure, traffic analysis, masquerade, content, sequence and timing modification.
- MD5: 128-bit digest, 512-bit block, padding to 448 mod 512, 64-bit length, 4 rounds of 16 steps.
- SHA-512: 512-bit digest, 1024-bit block, padding to 896 mod 1024, 128-bit length, 80 rounds, 64-bit words.
- SHA-1: 160-bit digest, 512-bit block, 80 steps.
- Birthday bound: collision costs $2^{n/2}$, so $2^{256}$ for SHA-512.
- DSS: $r = (g^k \bmod p) \bmod q$, $s = k^{-1}(H(M) + xr) \bmod q$, check $v = r$.
- DSS sizes: $q$ is 160 bits, $p$ is 512-1024 bits.
- Kerberos: AS gives TGT, TGS gives service ticket, then the server gets the ticket and authenticator.
- Public-key distribution: announcement, directory, authority, certificates.
Memory hooks
- SHA-512: "1024 in, 896 pad, 128 length, 80 rounds, 512 out".
- DSS verify: "w, u1, u2, v, then v equals r".
- Kerberos: "AS gives the pass, TGS gives the ticket, V gives the service".
- MD5 functions: F, G, H, I for rounds 1 to 4.
- Public keys: announce, directory, authority, certificate.
Coverage checklist
- Message Authentication: Nov 2023 attacks and two levels.
- Digital Signature: covered, and asked under DSS.
- Key Management: Nov 2022 public-key distribution.
- Key Exchange: Diffie-Hellman, no past questions.
- Hash Function: Dec 2025 MD5 versus SHA.
- Universal Hashing: no past questions.
- Cryptographic Hash Function: no past questions.
- MD: Nov 2022 MD5 with diagram.
- Secure Hash Algorithm (SHA): Dec 2020 compression, Dec 2020 and Jun 2025 SHA-512 steps, Nov 2022 merit and demerit.
- Digital Signature Standard (DSS): Dec 2020, Nov 2023, Jun 2025, Dec 2025.
- Cryptanalysis: Time-Memory Trade-off Attack: no past questions.
- Differential Cryptanalysis: no past questions.
- Secure channel and authentication system like Kerberos: Dec 2020, Dec 2025 servers, Jun 2025 inter-realm.