Information Security, Past Papers, University of the Punjab

Information Security Past Paper Spring 2025 – BS 5th Semester Punjab University (CC-312)

Semester5th
Year2025
Course codeCC-312
AnswersSolved ✓

University of the Punjab BS 4-year programme, fifth semester Spring 2025, Information Security (CC-312) paper (60 marks, 3 hours). The question paper is the official University of the Punjab paper published on pu.edu.pk (BS 4-year programme past papers, Spring 2025); it is retyped here and the answers are written by Shining Study. Worked solutions checked in Python: RSA private-key encryption, double columnar transposition (ANALYST), Playfair with SHALIMAR, Diffie–Hellman (51, 4, key 30), GF(2⁸) in MixColumns, IPsec tunnel mode, Kerberos, Playfair limits, digital signatures and AES SubBytes/ShiftRows/MixColumns.

Solved answers

Q1 – Short questions (6 × 5)

1. Encrypting with the sender’s private key (RSA). When the sender encrypts (signs) with his own private key, anyone can decrypt with the sender’s public key, so confidentiality is NOT provided. What is ensured is authentication (only the sender has the private key, so the message must come from him), integrity (any change makes decryption/verification fail, especially when a hash is signed) and non-repudiation (the sender cannot later deny sending it). This is the basis of digital signatures. For confidentiality as well, the result must also be encrypted with the receiver’s public key.

2. Double columnar transposition with keyword ANALYST. Keyword ANALYST (7 letters) gives the column order by alphabet (ties left to right): A₁=1, N=4, A₂=2, L=3, Y=7, S=5, T=6 → columns are read in the order 1, 3, 4, 2, 6, 7, 5. The ciphertext has 49 letters = 7 rows × 7 columns. Writing the ciphertext into the columns in this key order (7 letters each) and reading the grid row by row gives:

A N A L Y S T
1 4 2 3 7 5 6
-------------
T H E N O S E
I S P O I N T
I N G D O W N
A N G T H E H
O U S E S A R
E G E T T I N
G B I G G E R
Plaintext after one decryption with ANALYST: THE NOSE IS POINTING DOWN ANG THE HOUSES ARE GETTING BIGGER – i.e. “The nose is pointing down and the houses are getting bigger” (the “G” in “ANG” is a misprint for D in the given ciphertext). The paper gives only the 1st keyword: with a double transposition the receiver would first undo the 2nd keyword’s transposition and then this one. Because one round with ANALYST already gives readable English, the given ciphertext corresponds to the last (ANALYST) round. Applying ANALYST a second time would scramble the text, so the second keyword is needed for a true double transposition.

3. Playfair decryption with key SHALIMAR. Key square (I/J together, repeated letters dropped):

S H A L I
M R B C D
E F G K N
O P Q T U
V W X Y Z
Rules for decryption: same row → take the letter to the left; same column → the letter above; rectangle → the letter in the same row but the other corner’s column. Pairs: UL LE CP VG HT GL OI LG RC GW UX HU PA VZ → TI SK RT XE LP KA US AK MB FX QZ IP QH ZY.
The result “TISKRTXELPKAUSAKMBFXQZIPQHZY” is not meaningful English, and the same happens with the other usual square conventions (I/J or Q omitted, row/column direction swapped). So the ciphertext as printed is most probably mis-typed or was made with a different key; in the exam, the student is expected to show the key square and apply the rules above pair by pair as shown.

4. Diffie–Hellman, q = 71, a = 7. YA = 7⁵ mod 71 = 16807 mod 71 = 51.
YB = 7¹² mod 71 = 4 (7² = 49, 7⁴ = 49² mod 71 = 58, 7⁸ = 58² mod 71 = 27, 7¹² = 27 × 58 mod 71 = 4).
Shared key: K = YBXA mod 71 = 4⁵ mod 71 = 1024 mod 71 = 30, and also YAXB = 51¹² mod 71 = 30 ✓.

5. GF(2)[x] and its role in MixColumns. GF(2)[x] is the set of polynomials whose coefficients are bits (0 or 1), with addition = XOR. AES works in the finite field GF(2⁸) = GF(2)[x] / m(x), where m(x) = x⁸ + x⁴ + x³ + x + 1 (0x11B). Every byte b₇…b₀ is a polynomial b₇x⁷ + … + b₀. In MixColumns each column of the state is multiplied by the fixed matrix [02 03 01 01; 01 02 03 01; 01 01 02 03; 03 01 01 02]: multiplication by 02 is a left shift and XOR with 0x1B if the high bit was 1 (xtime); 03·b = (02·b) ⊕ b; additions are XOR. Because GF(2⁸) is a field, every non-zero byte has an inverse, so MixColumns is invertible (InvMixColumns uses 0E 0B 0D 09). Its role is diffusion: each output byte depends on all four input bytes of the column, so a change in one byte spreads to the whole column and, with ShiftRows, to the whole state after two rounds. (The S-box also uses GF(2⁸) inverses; the E and L tables in the paper are exponent/log tables used to multiply quickly in GF(2⁸).)

6. Transport (transparent) vs tunnel mode and VPN. In IPsec transport mode only the payload of the original IP packet is protected; the original IP header (real source and destination addresses) stays visible – it is “transparent”. In tunnel mode the whole original packet (header + data) is encrypted and placed inside a new IP packet with a new outer header (gateway addresses). Tunnel mode is the one closest to a VPN: it creates a secure tunnel between two gateways/networks over the internet, hides internal addresses and traffic patterns, works for whole networks (site-to-site and remote-access VPNs) and the internal hosts need no IPsec themselves. Transport mode is used for end-to-end host security.

Q2 (1) – Kerberos: same IP, eavesdropping and replay

A Kerberos ticket contains the client’s name, the server name, a session key, a timestamp/lifetime and (in v4 and optionally v5) the client’s network address, all encrypted with the server’s secret key. So a ticket is normally usable only from the IP address it was issued for; the same ticket can be reused from the same IP address for many requests to the same server until it expires (that is the purpose of a ticket-granting ticket – no password retyping). Kerberos v5 allows tickets without addresses or with several addresses (e.g. for NAT/mobile clients), so “same IP” is not strictly required in v5.

  • Eavesdropping: the password never travels on the network; the client’s key is derived from the password and used only locally. Tickets and session keys are encrypted (AES/DES) with keys known only to the KDC and the server, so an eavesdropper only sees ciphertext.
  • Replay attacks: each request includes an authenticator (client name + timestamp) encrypted with the session key; the server accepts it only if the timestamp is within a small clock skew (usually 5 minutes) and keeps a replay cache to reject the same authenticator twice. Tickets also have short lifetimes, and mutual authentication (server returns timestamp + 1) proves the server is genuine.

Q2 (2a) – Can “FA%$Hh33ededed” be encrypted with Playfair?

Not directly. The classic Playfair cipher uses a 5 × 5 matrix of 25 capital letters (I/J combined). It has no place for symbols (%, $), digits (3) or lower/upper case difference, so these characters cannot be encrypted. Options: (i) drop the non-letters and convert to capitals – only the letters FAHHEDEDED can be encrypted, losing information; or (ii) use an extended 6 × 6 matrix (A–Z + 0–9) for digits, which still cannot handle % and $.

If only the letters are kept: FAHHEDEDED → pairs FA HX HE DE DE DX (X inserted between the double H and as filler). With the key square SHALIMAR from Q1 (3): FA→GH, HX→AW, HE→SF, DE→MN, DE→MN, DX→BZ ⇒ ciphertext GHAWSFMNMNBZ. Note the repeated “DE DE” gives repeated “MN MN”, showing Playfair’s weakness against frequency analysis.

Q2 (2b) – Digital signatures for authentication

SENDER                                            RECEIVER
Message M --> Hash H(M) --> Encrypt with          M + Signature S
                             sender PRIVATE key  ===========> 
                             = Signature S        Hash H(M) again   Decrypt S with sender PUBLIC key
                                                        \              /
                                                     compare: equal -> authentic & unchanged

Steps: the sender computes a hash (e.g. SHA-256) of the message and encrypts the hash with his private key – this is the signature, sent with the message. The receiver decrypts the signature with the sender’s public key (obtained from a certificate issued by a CA) and compares it with a freshly computed hash. If they match, the message is authentic (came from the private-key holder), has integrity (not changed) and gives non-repudiation. Algorithms: RSA signatures, DSA, ECDSA.

Q2 (3) – AES steps on the given state

Bytes are written column by column (first 4 bytes = column 0). The key bytes “2N” and “6N” are not valid hex; they are misprints of 20 and 6E (the well-known example key “Thats my Kung Fu” = 54 68 61 74 73 20 6D 79 20 4B 75 6E 67 20 46 75).

1. State as a 4 × 4 matrix (and the key matrix):

Col 0Col 1Col 2Col 3
594F4E20
776E6954
6F656F77
2020656F
Key c0c1c2c3
54732067
68204B20
616D7546
74796E75

2. SubBytes (each byte replaced from the S-box; e.g. 59 → row 5, column 9 → CB; 20 → B7; 6F → A8):

Col 0Col 1Col 2Col 3
CB842FB7
F59FF920
A84DA8F5
B7B74DA8

3. ShiftRows (row 0 unchanged, row 1 left by 1, row 2 by 2, row 3 by 3):

Col 0Col 1Col 2Col 3
CB842FB7
9FF920F5
A8F5A84D
A8B7B74D

4. MixColumns (multiply each column by the fixed matrix in GF(2⁸)). Working for column 0 = (CB, 9F, A8, A8):

02·CB = 8D   03·9F = BA   01·A8 = A8   01·A8 = A8  ->  8D^BA^A8^A8 = 37
01·CB = CB   02·9F = 25   03·A8 = E3   01·A8 = A8  ->  CB^25^E3^A8 = A5
01·CB = CB   01·9F = 9F   02·A8 = 4B   03·A8 = E3  ->  CB^9F^4B^E3 = FC
03·CB = 46   01·9F = 9F   01·A8 = A8   02·A8 = 4B  ->  46^9F^A8^4B = 3A

(02·CB: CB = 1100 1011, shift left = 1001 0110 (drop the overflow bit) ⊕ 1B = 8D; 03·CB = 8D ⊕ CB = 46.) Result after MixColumns:

Col 0Col 1Col 2Col 3
37412171
A5DE3BDC
FC4E860F
3AEE8CE0

Note: in the full AES algorithm the initial AddRoundKey (state ⊕ key) is done first. Doing that gives 0D 1F 0E 54 | 3C 4E 08 59 | 6E 22 1A 0B | 47 74 31 1A (column-wise), and after SubBytes, ShiftRows and MixColumns of round 1: C4 D6 5A B0 | 84 A4 8D 32 | E8 8D 06 0E | 1B 40 7D 5D. The paper asks the steps on the given state, so the main answer above applies them directly. All values were computed with a Python AES implementation (S-box checked against the standard table).

Save this paper for offline studyDownload the question paper, or save the paper together with all solved answers as a PDF.
↓ Download Paper (JPG)
Have another year of Information Security?

Upload a photo in 10 seconds — no form to fill. We clean it, solve it and credit you.

Missing years for this subject
202620242023

About Saif R

An educator and technology enthusiast passionate about empowering students through quality education and digital learning. Dedicated to making academic resources and opportunities accessible to everyone.