Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Explain classical encryption techniques. Describe the Playfair cipher and the Hill cipher with examples of encryption.

Classical Encryption Techniques

Classical encryption operates on plaintext letters using substitution (replacing letters with others) and transposition (rearranging letter positions). They use a shared secret key and are vulnerable to frequency analysis. Two important polyalphabetic/digraph-and-matrix examples are the Playfair and Hill ciphers.

Playfair Cipher

The Playfair cipher is a digraph substitution cipher that encrypts pairs of letters using a 5×55\times5 key matrix built from a keyword (I and J share a cell).

Key = MONARCHY:

MONAR
CHYBD
EFGI/JK
LPQST
UVWXZ

Rules for each digraph (insert filler X between identical letters; pad odd length):

  1. Same row → take the letter to the right (wrap around).
  2. Same column → take the letter below (wrap around).
  3. Rectangle → each letter is replaced by the letter in its own row at the other letter's column.

Example: encrypt BALLOON → split as BA LX LO ON.

  • BA: rectangle → IBIB
  • LX: rectangle → SU
  • LO: rectangle → PM
  • ON: same row → NA

Ciphertext = IBSUPMNA.

Hill Cipher

The Hill cipher is a polygraphic substitution cipher based on linear algebra mod 26. A block of nn letters (as numbers A=0Z=25A=0\dots Z=25) is encrypted by multiplying with an invertible n×nn\times n key matrix KK:

C=KP(mod26),P=K1C(mod26).C = K \cdot P \pmod{26}, \qquad P = K^{-1} \cdot C \pmod{26}.

Example (2×22\times2): K=[3325]K=\begin{bmatrix}3 & 3\\2 & 5\end{bmatrix}, plaintext HI = [78]\begin{bmatrix}7\\8\end{bmatrix}.

C=[3325][78]=[4554][192](mod26).C=\begin{bmatrix}3&3\\2&5\end{bmatrix}\begin{bmatrix}7\\8\end{bmatrix}=\begin{bmatrix}45\\54\end{bmatrix}\equiv\begin{bmatrix}19\\2\end{bmatrix}\pmod{26}.

So ciphertext = TC. Decryption uses K1(mod26)K^{-1}\pmod{26} (which exists only if gcd(detK,26)=1\gcd(\det K,26)=1).

classical-ciphers
2long10 marks

What is a digital signature? Explain the digital signature scheme using RSA and the role of digital signatures in authentication and non-repudiation.

Digital Signature

A digital signature is a cryptographic value, computed from a message and the signer's private key, that lets any verifier confirm the message's authenticity, integrity and origin using the signer's public key. Unlike encryption (which provides confidentiality), a signature provides proof of who created the message and that it was not altered.

Digital Signature Scheme Using RSA

RSA can be used in reverse for signing: the signer encrypts the message digest with the private key, and anyone can verify with the public key.

Setup: key pair public (e,n)(e,n) and private (d,n)(d,n) where ed1(modϕ(n))ed\equiv1\pmod{\phi(n)}.

Signing (by sender):

  1. Compute a hash of the message: h=H(M)h = H(M).
  2. Sign with the private key: S=hdmodnS = h^{d} \bmod n.
  3. Send (M,S)(M, S).

Verification (by receiver):

  1. Recover the hash: h=Semodnh' = S^{e} \bmod n.
  2. Independently compute h=H(M)h = H(M).
  3. If h=hh' = h, the signature is valid; otherwise it is rejected.

Hashing before signing ensures fixed-size input, efficiency, and security.

Role in Authentication and Non-Repudiation

  • Authentication: Only the holder of the private key could produce a signature that verifies with the matching public key, so a valid signature authenticates the sender's identity.
  • Integrity: Because the signature is over the message hash, any change to MM makes H(M)hH(M)\ne h', exposing tampering.
  • Non-repudiation: Since the private key is known only to the signer, the signer cannot later deny having signed the message; the signature is binding evidence accepted by a third party (e.g., in disputes).
digital-signature
3long10 marks

Explain the RSA algorithm. Show how encryption and decryption are performed. Choose two primes p=7 and q=11, compute the public and private key pairs and encrypt the message M=8.

RSA Algorithm

RSA is a public-key (asymmetric) cryptosystem whose security rests on the difficulty of factoring the product of two large primes.

Key Generation

  1. Choose two large primes pp and qq.
  2. Compute n=pqn = p \cdot q (the modulus).
  3. Compute ϕ(n)=(p1)(q1)\phi(n) = (p-1)(q-1).
  4. Choose public exponent ee with 1<e<ϕ(n)1 < e < \phi(n) and gcd(e,ϕ(n))=1\gcd(e,\phi(n))=1.
  5. Compute private exponent de1(modϕ(n))d \equiv e^{-1} \pmod{\phi(n)}.
  • Public key =(e,n)= (e,n), Private key =(d,n)= (d,n).

Encryption / Decryption

C=Memodn,M=Cdmodn.C = M^{e} \bmod n, \qquad M = C^{d} \bmod n.

Worked Example: p=7,  q=11,  M=8p=7,\; q=11,\; M=8

  1. n=7×11=77n = 7\times11 = 77.
  2. ϕ(n)=(71)(111)=6×10=60\phi(n) = (7-1)(11-1) = 6\times10 = 60.
  3. Choose e=13e=13 (gcd(13,60)=1\gcd(13,60)=1).
  4. Find dd with 13d1(mod60)13d \equiv 1 \pmod{60}. Since 13×37=481=8×60+113\times37 = 481 = 8\times60 + 1, we get d=37d = 37.
  • Public key =(13,77)=(13,77), Private key =(37,77)=(37,77).

Encryption of M=8M=8:

C=813mod77.C = 8^{13} \bmod 77.

Compute by repeated squaring: 82=648^2=64, 84=642=4096158^4=64^2=4096\equiv15, 88152=22571(mod77)8^8\equiv15^2=225\equiv71\pmod{77}.

813=88848171158=852050(mod77).8^{13}=8^{8}\cdot8^{4}\cdot8^{1}\equiv71\cdot15\cdot8 = 8520 \equiv 50 \pmod{77}.

So C=50C = \mathbf{50}.

Verification (decryption): M=5037mod77=8M = 50^{37} \bmod 77 = 8, recovering the original message.

(Note: with e=7e=7 instead, d=43d=43 and C=87mod77=57C=8^7\bmod77=57; any valid ee coprime to 60 works.)

rsa
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Explain the families of SHA-2 and their differences from SHA-1.

SHA-2 Family and Differences from SHA-1

SHA-2 is a family of cryptographic hash functions designed by the NSA (2001) using a Merkle–Damgård construction with Davies–Meyer compression. Members differ in digest length and internal word size:

VariantDigest sizeWord/Block sizeRounds
SHA-224224 bits32-bit / 512-bit block64
SHA-256256 bits32-bit / 512-bit block64
SHA-384384 bits64-bit / 1024-bit block80
SHA-512512 bits64-bit / 1024-bit block80
SHA-512/224, SHA-512/256224/256 bitstruncated SHA-51280

Differences from SHA-1

  • Digest length: SHA-1 produces only 160 bits; SHA-2 produces 224–512 bits, giving a much larger output space.
  • Security: SHA-1 is broken for collision resistance (practical collisions demonstrated, e.g., SHAtter 2017); SHA-2 has no known practical collision attacks.
  • Rounds & complexity: SHA-2 uses more rounds (64/80) and a more complex message schedule and round function.
  • Word size: SHA-1 and SHA-256 use 32-bit words; SHA-384/512 use 64-bit words for efficiency on 64-bit hardware.

SHA-2 is therefore recommended over SHA-1 for digital signatures, certificates and integrity checks.

sha2
5short5 marks

What is Public Key Infrastructure (PKI)? Explain the role of a Certificate Authority and digital certificates.

Public Key Infrastructure (PKI)

PKI is the framework of hardware, software, policies, standards and procedures used to create, manage, distribute, store and revoke digital certificates and public–private key pairs. It binds public keys to verified identities, enabling secure, trusted communication over insecure networks.

Core components: Certificate Authority (CA), Registration Authority (RA), digital certificates, a certificate repository/directory, and a Certificate Revocation List (CRL)/OCSP.

Certificate Authority (CA)

The CA is the trusted third party that:

  • Verifies the identity of an applicant (often via an RA).
  • Issues digital certificates by digitally signing them with the CA's own private key.
  • Revokes compromised or expired certificates and publishes a CRL.
  • Acts as the root of trust; clients trust certificates that chain up to a trusted root CA.

Digital Certificates

A digital certificate (typically X.509) is an electronic document that binds a public key to an identity. It contains:

  • Subject name (owner) and the subject's public key,
  • Issuer (CA) name, serial number, validity period,
  • The CA's digital signature over the certificate.

When a party presents its certificate, the receiver verifies the CA's signature using the CA's public key, thereby trusting that the enclosed public key truly belongs to the named subject—providing authentication and enabling secure key exchange (e.g., in TLS/HTTPS).

pki
6short5 marks

Explain the basic logic of malicious code: viruses, worms and trojan horses.

Malicious Code: Viruses, Worms and Trojan Horses

Malicious code (malware) is any program intentionally written to damage systems, steal data or disrupt operations.

Virus

A virus is a code fragment that attaches itself to a host program or file and replicates by inserting copies into other programs when the infected host runs. It requires human action (running the infected file) to spread. Phases: dormant → propagation → triggering → execution (payload). Example: file-infector and macro viruses.

Worm

A worm is a standalone, self-replicating program that spreads automatically across networks by exploiting vulnerabilities, without needing a host file or user action. It consumes bandwidth and resources and can carry payloads. Example: Morris worm, Conficker.

Trojan Horse

A Trojan horse is a program that masquerades as legitimate or useful software but secretly performs malicious actions (e.g., installing a backdoor, stealing credentials). It does not self-replicate; it relies on social engineering to trick the user into installing it.

Key distinction: a virus needs a host and user action; a worm self-propagates over networks; a Trojan does not replicate but disguises its malicious intent.

malicious-code
7short5 marks

State the Chinese Remainder Theorem and use it to solve a system of congruences.

Chinese Remainder Theorem (CRT)

Statement: If m1,m2,,mkm_1, m_2, \dots, m_k are pairwise coprime positive integers and M=m1m2mkM = m_1 m_2 \cdots m_k, then the system

xa1(modm1),xa2(modm2), , xak(modmk)x \equiv a_1 \pmod{m_1},\quad x \equiv a_2 \pmod{m_2},\ \dots,\ x \equiv a_k \pmod{m_k}

has a unique solution modulo MM.

The solution is xi=1kaiMiyi(modM)x \equiv \sum_{i=1}^{k} a_i\, M_i\, y_i \pmod{M}, where Mi=M/miM_i = M/m_i and yi=Mi1modmiy_i = M_i^{-1} \bmod m_i.

Worked Example

Solve:

x2(mod3),x3(mod5),x2(mod7).x \equiv 2 \pmod 3,\qquad x \equiv 3 \pmod 5,\qquad x \equiv 2 \pmod 7.

M=357=105M = 3\cdot5\cdot7 = 105.

  • M1=105/3=35,  y1=351mod3=212M_1 = 105/3 = 35,\; y_1 = 35^{-1}\bmod 3 = 2^{-1}\equiv 2.
  • M2=105/5=21,  y2=211mod5=111M_2 = 105/5 = 21,\; y_2 = 21^{-1}\bmod 5 = 1^{-1}\equiv 1.
  • M3=105/7=15,  y3=151mod7=111M_3 = 105/7 = 15,\; y_3 = 15^{-1}\bmod 7 = 1^{-1}\equiv 1.
x2(35)(2)+3(21)(1)+2(15)(1)=140+63+30=233(mod105).x \equiv 2(35)(2) + 3(21)(1) + 2(15)(1) = 140 + 63 + 30 = 233 \pmod{105}.

233mod105=23233 \bmod 105 = 23.

Answer: x23(mod105)x \equiv \mathbf{23} \pmod{105} (check: 23mod3=223\bmod3=2, 23mod5=323\bmod5=3, 23mod7=223\bmod7=2).

chinese-remainder
8short5 marks

Explain the goals of security: confidentiality, integrity and availability. List the different types of security attacks.

Security Goals (CIA Triad) and Types of Attacks

Goals of Security

  • Confidentiality: Ensures information is accessible only to authorized parties; prevents unauthorized disclosure (achieved by encryption, access control).
  • Integrity: Ensures data is accurate and not altered by unauthorized parties; any modification is detectable (achieved by hashes, MACs, digital signatures).
  • Availability: Ensures systems and data are accessible to authorized users whenever needed (protected against DoS, ensured by redundancy/backups).

Types of Security Attacks

Classified (per Stallings) as passive and active:

Passive attacks (eavesdropping; hard to detect, aim is to obtain information):

  • Release of message contents
  • Traffic analysis

Active attacks (modify data or affect operation):

  • Masquerade – pretending to be another entity
  • Replay – capturing and retransmitting data
  • Modification of messages – altering content/order
  • Denial of Service (DoS) – disrupting availability

Alternatively by goal: interception (confidentiality), modification & fabrication (integrity), and interruption (availability).

security-services
9short5 marks

Differentiate between symmetric and asymmetric key cryptography with examples.

Symmetric vs Asymmetric Key Cryptography

FeatureSymmetric KeyAsymmetric Key
KeysSingle shared secret key for both encrypt & decryptKey pair: public key + private key
Key distributionHard — secret key must be shared securelyEasy — public key can be freely distributed
SpeedFast, efficient for bulk dataSlow (heavy math), used for small data
Number of keysn(n1)/2n(n-1)/2 keys for nn users2n2n keys (nn pairs)
Used forBulk encryptionKey exchange, digital signatures
ExamplesDES, 3DES, AES, RC4, BlowfishRSA, Diffie–Hellman, ElGamal, ECC

Symmetric cryptography uses the same key, e.g., AES encrypts and decrypts a file with one shared key. Asymmetric uses mathematically related but different keys: data encrypted with the public key can only be decrypted with the matching private key (e.g., RSA); this solves the key-distribution problem and enables digital signatures.

In practice, hybrid systems combine both: asymmetric crypto exchanges a session key, then fast symmetric crypto encrypts the actual data.

symmetric-asymmetric
10short5 marks

Explain the Caesar cipher and the mono-alphabetic substitution cipher with examples of their cryptanalysis.

Caesar Cipher and Mono-alphabetic Substitution

Caesar Cipher

A Caesar cipher shifts each plaintext letter by a fixed key kk:

C=(P+k)mod26,P=(Ck)mod26.C = (P + k) \bmod 26,\qquad P = (C - k) \bmod 26.

Example (k=3k=3): HELLOKHOOR.

Cryptanalysis: there are only 25 possible keys, so a brute-force (exhaustive key search) attack tries all shifts and inspects which produces readable plaintext — trivially broken.

Mono-alphabetic Substitution Cipher

Each plaintext letter is mapped to a fixed but arbitrary ciphertext letter using a permutation of the alphabet, giving a key space of 26!4×102626! \approx 4\times10^{26}, far too large for brute force.

Cryptanalysis: it is broken by frequency analysis, because the substitution preserves the statistical structure of the language. The analyst:

  1. Counts letter frequencies in the ciphertext.
  2. Maps the most frequent ciphertext letters to common English letters (E, T, A, O...).
  3. Uses common digrams (TH, HE) and trigrams (THE, ING) to refine the mapping until plaintext emerges.

Thus, despite a huge key space, the mono-alphabetic cipher is insecure because it leaks language statistics.

caesar-cipher
11short5 marks

Explain modular arithmetic and Euler's totient function. Compute phi(35) and phi(24).

Modular Arithmetic and Euler's Totient Function

Modular Arithmetic

Modular arithmetic deals with integers that wrap around upon reaching a modulus nn. We write ab(modn)a \equiv b \pmod n if n(ab)n \mid (a-b), i.e., aa and bb leave the same remainder when divided by nn. It satisfies addition, subtraction and multiplication congruences and is the foundation of RSA, Diffie–Hellman, etc. Example: 172(mod5)17 \equiv 2 \pmod 5.

Euler's Totient Function ϕ(n)\phi(n)

ϕ(n)\phi(n) counts the positive integers n\le n that are coprime to nn (i.e., gcd(k,n)=1\gcd(k,n)=1).

  • For a prime pp: ϕ(p)=p1\phi(p) = p-1.
  • If n=p1a1p2a2n = p_1^{a_1} p_2^{a_2}\cdots, then ϕ(n)=ni(11pi)\phi(n) = n\prod_i\left(1-\dfrac{1}{p_i}\right).
  • Multiplicative: ϕ(mn)=ϕ(m)ϕ(n)\phi(mn)=\phi(m)\phi(n) when gcd(m,n)=1\gcd(m,n)=1.

Computations

ϕ(35)\phi(35): 35=5×735 = 5 \times 7 (both prime), so

ϕ(35)=(51)(71)=4×6=24.\phi(35) = (5-1)(7-1) = 4 \times 6 = \mathbf{24}.

ϕ(24)\phi(24): 24=23×324 = 2^3 \times 3, so

ϕ(24)=24(112)(113)=24×12×23=8.\phi(24) = 24\left(1-\tfrac12\right)\left(1-\tfrac13\right) = 24 \times \tfrac12 \times \tfrac23 = \mathbf{8}.
modular-arithmetic
12short5 marks

Explain the ElGamal cryptographic system for encryption and decryption.

ElGamal Cryptosystem

ElGamal is a public-key encryption scheme whose security relies on the difficulty of the discrete logarithm problem in a cyclic group. It is probabilistic (randomized).

Key Generation

  1. Choose a large prime pp and a primitive root (generator) gg of Zp\mathbb{Z}_p^{*}.
  2. Choose a private key xx with 1xp21 \le x \le p-2.
  3. Compute y=gxmodpy = g^{x} \bmod p.
  • Public key =(p,g,y)= (p, g, y), Private key =x= x.

Encryption (of message MM, M<pM < p)

  1. Pick a random ephemeral key kk, 1kp21 \le k \le p-2.
  2. Compute C1=gkmodpC_1 = g^{k} \bmod p and C2=MykmodpC_2 = M \cdot y^{k} \bmod p.
  3. Ciphertext =(C1,C2)= (C_1, C_2).

Decryption

Using private key xx:

M=C2(C1x)1modp,M = C_2 \cdot (C_1^{x})^{-1} \bmod p,

since C1x=gkx=ykC_1^{x} = g^{kx} = y^{k}, the masking factor cancels.

Example

Let p=11p=11, g=2g=2, private x=3x=3, so y=23mod11=8y = 2^3 \bmod 11 = 8. Encrypt M=7M=7 with k=4k=4:

  • C1=24mod11=5C_1 = 2^4 \bmod 11 = 5.
  • C2=784mod11=74096mod11=74=286C_2 = 7 \cdot 8^{4} \bmod 11 = 7 \cdot 4096 \bmod 11 = 7 \cdot 4 = 28 \equiv 6.
  • Ciphertext =(5,6)=(5,6).

Decrypt: C1x=53=1254C_1^{x}=5^3=125\equiv 4; inverse of 4mod114 \bmod 11 is 33; M=63=187(mod11)M = 6\cdot3 = 18 \equiv 7 \pmod{11}. ✓

elgamal

Frequently asked questions

Where can I find the BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) question paper 2080?
The full BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2080 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Cryptography (BSc CSIT, CSC316) 2080 paper come with solutions?
Yes. Every question on this Cryptography (BSc CSIT, CSC316) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2080 paper?
The BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2080 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Cryptography (BSc CSIT, CSC316) past paper free?
Yes — reading and attempting this Cryptography (BSc CSIT, CSC316) past paper on Kekkei is completely free.