Tribhuwan University

Institute of Science and Technology

2081

Bachelor Level / Third Year / Fifth Semester / Science

B.Sc in Computer Science and Information Technology (CSC327)

(Cryptography)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
Let us consider the 4 bits key set as {1100, 1010, 0000, 1111, 0101, 1001} and input text as {1011, 1110, 1011, 1000}. Now trace the first full round operation of IDEA algorithm.[10]

Tracing the First Full Round of IDEA Algorithm

IDEA (International Data Encryption Algorithm) is a symmetric block cipher that operates on 64-bit plaintext blocks using a 128-bit key, performing 8 identical rounds with operations: multiplication modulo 216+12^{16}+1, addition modulo 2162^{16}, and XOR.


Given Data

  • Key subkeys (4-bit each): K1=1100K_1 = 1100, K2=1010K_2 = 1010, K3=0000K_3 = 0000, K4=1111K_4 = 1111, K5=0101K_5 = 0101, K6=1001K_6 = 1001
  • Input text blocks (4-bit each): X1=1011X_1 = 1011, X2=1110X_2 = 1110, X3=1011X_3 = 1011, X4=1000X_4 = 1000

IDEA First Round Structure

In each round, 6 subkeys are used. The operations in one full round are:


Step-by-Step Trace

Step A: Initial Four Operations

  • i) X1K1X_1 \odot K_1 (Multiply mod $2^4 + 1 = 17$)

X1K1=1011×1100mod17=11×12mod17=132mod17=1327(17)=132119=13=1101X_1 \odot K_1 = 1011 \times 1100 \mod 17 = 11 \times 12 \mod 17 = 132 \mod 17 = 132 - 7(17) = 132 - 119 = 13 = 1101

  • ii) X2K2X_2 \boxplus K_2 (Add mod $2^4 = 16$)

X2K2=1110+1010mod16=14+10mod16=24mod16=8=1000X_2 \boxplus K_2 = 1110 + 1010 \mod 16 = 14 + 10 \mod 16 = 24 \mod 16 = 8 = 1000

  • iii) X3K3X_3 \boxplus K_3 (Add mod $2^4 = 16$)

X3K3=1011+0000mod16=11+0mod16=11=1011X_3 \boxplus K_3 = 1011 + 0000 \mod 16 = 11 + 0 \mod 16 = 11 = 1011

  • iv) X4K4X_4 \odot K_4 (Multiply mod $2^4 + 1 = 17$)

X4K4=1000×1111mod17=8×15mod17=120mod17=1207(17)=120119=1=0001X_4 \odot K_4 = 1000 \times 1111 \mod 17 = 8 \times 15 \mod 17 = 120 \mod 17 = 120 - 7(17) = 120 - 119 = 1 = 0001


Step B: XOR Operations

  • v) Step(i) \oplus Step(iii):

11011011=01101101 \oplus 1011 = 0110

  • vi) Step(ii) \oplus Step(iv):

10000001=10011000 \oplus 0001 = 1001


Step C: MA (Multiplication-Addition) Structure

  • vii) Step(v) K5\odot K_5 (Multiply mod 17):

0110×0101mod17=6×5mod17=30mod17=13=11010110 \times 0101 \mod 17 = 6 \times 5 \mod 17 = 30 \mod 17 = 13 = 1101

  • viii) Step(vi) \boxplus Step(vii) (Add mod 16):

1001+1101mod16=9+13mod16=22mod16=6=01101001 + 1101 \mod 16 = 9 + 13 \mod 16 = 22 \mod 16 = 6 = 0110

  • ix) Step(viii) K6\odot K_6 (Multiply mod 17):

0110×1001mod17=6×9mod17=54mod17=543(17)=5451=3=00110110 \times 1001 \mod 17 = 6 \times 9 \mod 17 = 54 \mod 17 = 54 - 3(17) = 54 - 51 = 3 = 0011

  • x) Step(vii) \boxplus Step(ix) (Add mod 16):

1101+0011mod16=13+3mod16=16mod16=0=00001101 + 0011 \mod 16 = 13 + 3 \mod 16 = 16 \mod 16 = 0 = 0000


Step D: Final XOR Operations

  • xi) Step(i) \oplus Step(ix): 11010011=11101101 \oplus 0011 = 1110
  • xii) Step(iii) \oplus Step(ix): 10110011=10001011 \oplus 0011 = 1000
  • xiii) Step(ii) \oplus Step(x): 10000000=10001000 \oplus 0000 = 1000
  • xiv) Step(iv) \oplus Step(x): 00010000=00010001 \oplus 0000 = 0001

Output of First Round

After swapping the inner two blocks (Step xii and Step xiii):

Output=1110100010000001\text{Output} = 1110 \quad | \quad 1000 \quad | \quad 1000 \quad | \quad 0001


Conclusion: The first full round of IDEA uses all 6 subkeys and combines three algebraically incompatible operations (XOR, addition mod 2n2^n, multiplication mod $2^n+1$) to achieve strong diffusion and confusion in a single round itself.

2.
What is Message Authentication Code? List the operation of computing digest value in different passes of MD4. Describe about Needhom-Schroeder protocol.[10]
3.
Why do we need discrete logarithm? Illustrate with an example. Consider a Diffie-Hellman scheme with a common prime p = 13 between user A and user B. Suppose public key of A is 10 and public key of B is 8. Now determine their private keys and shared secret key. Select any valid primitive root of 13.[10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Show the encryption of plain text "ALGORITHM" using the key "PSEUDOCODE" using playfair cipher. [5]
5.
Discuss the working mechanism of kerberos protocol. [5]
6.
What is the use of firewall? How circuit level gateway differs from stateful inspection firewall? [5]
7.
What is intrusion? Explain any two types of intrusion detection system. [5]
8.
Find the multiplicative inverse of polynomial (95) using extended euclidean Algorithm. [5]
9.
What is DoS attack? Discuss about PKI trust model. [5]
10.
Using Vigenere cipher with key = “worlds”, encrypt the plain text “hello everyone”. [5]
11.
Describe the different modes of block cipher. [5]
12.
Write short notes on (any two) a. Totient value of any positive integer. b. Properties of hash function. c. Virus or Worms. [5]