CSC327 · TU past paper
Cryptography 2079 question paper
The complete TU 2079 exam paper for Cryptography (CSC327), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- Q1.Advanced Encryption StandardsHideAnswer
Security Policy and Mechanism, Block vs Stream Cipher, and AES Key Expansion
- Q2.10 marksProperties of Hash functionsHideAnswer
Describe the properties of hash functions. Discuss how hash value is generated using SHA-1 algorithm.[10]
- Q3.10 marksNumericalElgamal Cryptographic SystemHideAnswer
Show that Z 5 is a field. John publishes the ElGamal public key (q, α, YA) =(101, 2, 14). Jane desired to send the secret message CSIT to John. Using the equivalence A = 0, B=1, ..., Z=25, encrypt the message using John’s public key. Use a random number k = 4.[10]
- Q4.5 marksTypes of Malicious LogicHideAnswer
Differentiate between Trojan horse and virus. Describe any two types of intruders. [5]
- Q5.5 marksNumericalSubstitution TechniquesHideAnswer
The message “IMOGUN” was encrypted with a Playfair cipher using keyword “GALOIS”. Decrypt the message. [5]
- Q6.5 marksInternational Data Encryption StandardHideAnswer
How encryption is done using IDEA algorithm. [5]
- Q7.5 marksEmail SecurityHideAnswer
Describe the services provided by Pretty Good Privacy protocol to secure email. [5]
- Q8.5 marksChallenge Response SystemHideAnswer
Define challenge response system. Why do we need Kerberos? [5]
- Q9.5 marksDigital SignaturesHideAnswer
How direct digital signature different from arbitrated digital signature? How digital signature generation and verification is done using RSA. [5]
- Q10.5 marksNumericalHideAnswer
Why do we need discrete logarithm over normal logarithm? Find out whether 3 is primitive root of 7 or not. [5]
- Q11.5 marksNumericalTransposition TechniquesHideAnswer
Which one is more secure, monoalphabetic cipher or poly alphabetic cipher? Justify. Using rail fence cipher encrypt the text 'LEARNING AND TEACHING ARE DIFFERENT' using 3 as rails. [5]
- Q12.5 marksNumericalNumber TheoryHideAnswer
What is the condition of for two integers, x and y, to be relatively prime? Find whether 61 is prime or not using Miller-Rabin algorithm. [5]
Relatively Prime Condition and Miller-Rabin Test for 61
Given
- Number to test: $n = 61$
- Question asks: (a) condition for two integers $x, y$ to be relatively prime; (b) test primality of 61 using Miller-Rabin.
- No specific witness $a$ is given, so we choose valid witnesses.
Solution
Part 1: Condition for Relatively Prime
Two integers $x$ and $y$ are relatively prime (coprime) if and only if their greatest common divisor is 1:
$$\gcd(x, y) = 1$$
They share no common positive divisor other than 1.
Example: $\gcd(8, 15) = 1$, so 8 and 15 are relatively prime.
Part 2: Miller-Rabin Test for n = 61
Step 1: Write $n - 1 = 2^k \cdot m$, m odd
$$n - 1 = 60 = 2^2 \times 15$$
So $k = 2$, $m = 15$ (odd, confirmed).
Step 2: Choose witness $a = 2$ (valid: $1 < 2 < 60$).
Step 3: Compute $b = a^m \bmod n = 2^{15} \bmod 61$
$$2^{15} = 32768$$ $$32768 \bmod 61: \quad 61 \times 537 = 32757, \quad 32768 - 32757 = 11$$
Cross-check via the alternative decomposition: $b = 11$.
Step 4: Is $b = 1$? No, $11 \neq 1$. Proceed to loop.
Step 5: Loop $i = 0$ to $k-1 = 1$
Check $b = n - 1 = 60$ at start of each iteration:
-
$i = 0$: $b = 11 \neq 60$. Square: $b = 11^2 = 121 \equiv 121 - 61 = 60 \pmod{61}$.
Now $b = 60 = -1 \pmod{61}$ at the moment it is produced.
Note on algorithm form: In the correct Miller-Rabin loop, after squaring we check whether we hit $-1$. The sequence of squarings starting from $2^{15}$ is:
$$2^{15} \equiv 11, \quad 2^{30} \equiv 11^2 = 60 \equiv -1 \pmod{61}$$
Since one of the values $a^{2^i m}$ equals $-1$ (here $2^{30} \equiv -1$), the test declares probably prime. Witness $a = 2$ is a strong liar-free result: 61 passes.
$$11^2 = 121, \quad 121 - 61 = 60 \quad (\text{not } 59)$$
Therefore, with $a = 2$ itself, the test returns Prime (no second witness needed).
Double-check with $a = 7$:
$$7^2 = 49,\ 7^4 = 49^2 = 2401 \equiv 2401 - 39(61)=2401-2379=22$$ $$7^8 = 22^2 = 484 \equiv 484 - 7(61) = 484 - 427 = 57$$ $$7^{15} = 7^8 \cdot 7^4 \cdot 7^2 \cdot 7 = 57 \cdot 22 \cdot 49 \cdot 7 \pmod{61}$$ $$57 \cdot 22 = 1254 \equiv 1254 - 20(61)=1254-1220=34$$ $$34 \cdot 49 = 1666 \equiv 1666 - 27(61)=1666-1647=19$$ $$19 \cdot 7 = 133 \equiv 133 - 2(61) = 11 \pmod{61}$$
So $7^{15} \equiv 11 \neq 1, \neq 60$. Square: $11^2 = 121 \equiv 60 \equiv -1$. Returns Prime.
(Note that $7^{15} \equiv 11$, not $60$; the squaring still gives $-1$, so the conclusion "Prime" holds.)
Conclusion
$$\boxed{61 \text{ is Prime (probably prime by Miller-Rabin)}}$$