Tribhuwan University

Institute of Science and Technology

2081

Bachelor Level / Third Year / Fifth Semester / Science

Bachelors in Information Technology (BIT303)

(Information Security)

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.
Consider p=11 and q=7 in a RSA cryptosystem. i. What is a public key pair (e, n)? ii. What is a private key pair (d, n)? iii. What is ciphertext for M=6?[10]

RSA Cryptosystem with p=11 and q=7

RSA is an asymmetric encryption algorithm where the public key is used for encryption and the private key for decryption, based on the difficulty of factoring large prime numbers.


Given:

  • p=11p = 11, q=7q = 7

Step A: Compute n and φ(n)

n=p×q=11×7=77n = p \times q = 11 \times 7 = 77

ϕ(n)=(p1)(q1)=10×6=60\phi(n) = (p-1)(q-1) = 10 \times 6 = 60


i. Public Key Pair (e, n)

Choose e such that:

  • 1<e<ϕ(n)1 < e < \phi(n)
  • gcd(e,ϕ(n))=1\gcd(e, \phi(n)) = 1 (e must be coprime with 60)

Let's try e=7e = 7:

gcd(7,60)=1\gcd(7, 60) = 1 \quad

Public Key = (e, n) = (7, 77)


ii. Private Key Pair (d, n)

Find d such that:

d×e1(modϕ(n))d \times e \equiv 1 \pmod{\phi(n)}

d×71(mod60)d \times 7 \equiv 1 \pmod{60}

We need to find multiplicative inverse of 7 mod 60.

Using Extended Euclidean Algorithm:

  • 60=8×7+460 = 8 \times 7 + 4
  • 7=1×4+37 = 1 \times 4 + 3
  • 4=1×3+14 = 1 \times 3 + 1
  • 3=3×1+03 = 3 \times 1 + 0

Back substitution:

  • 1=41×31 = 4 - 1 \times 3
  • 1=41×(71×4)=2×41×71 = 4 - 1 \times (7 - 1 \times 4) = 2 \times 4 - 1 \times 7
  • 1=2×(608×7)1×7=2×6017×71 = 2 \times (60 - 8 \times 7) - 1 \times 7 = 2 \times 60 - 17 \times 7

So d=176017=43(mod60)d = -17 \equiv 60 - 17 = 43 \pmod{60}

Verification: 43×7=301=5×60+11(mod60)43 \times 7 = 301 = 5 \times 60 + 1 \equiv 1 \pmod{60}

Private Key = (d, n) = (43, 77)


iii. Ciphertext for M = 6

Encryption formula:

C=MemodnC = M^e \mod n

C=67mod77C = 6^7 \mod 77

Computing step by step:

  • 61=66^1 = 6
  • 62=366^2 = 36
  • 64=362=1296mod77=129616×77=12961232=646^4 = 36^2 = 1296 \mod 77 = 1296 - 16 \times 77 = 1296 - 1232 = 64
  • 67=64×62×61=64×36×66^7 = 6^4 \times 6^2 \times 6^1 = 64 \times 36 \times 6

Now:

  • 64×36=2304mod77=230429×77=23042233=7164 \times 36 = 2304 \mod 77 = 2304 - 29 \times 77 = 2304 - 2233 = 71
  • 71×6=426mod77=4265×77=426385=4171 \times 6 = 426 \mod 77 = 426 - 5 \times 77 = 426 - 385 = 41

Ciphertext C = 41


Summary Table

Parameter Value
n 77
φ(n) 60
Public Key (e, n) (7, 77)
Private Key (d, n) (43, 77)
Plaintext M 6
Ciphertext C 41

Conclusion: RSA security relies on the difficulty of factoring nn back into pp and qq. The public key encrypts the message, and only the holder of the private key can decrypt it.

2.
Discuss how encryption and decryption is done in the DES algorithm.[10]
3.
Define subjects, objects and access rights in access control with suitable examples. How role based access control is different from attribute based access control?[10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
How online and offline dictionary attacks are done in password based authentication systems? [5]
5.
Describe the roles of relying parties, attribute providers and identity providers in Open Identity Trust Framework. [5]
6.
Define zombies, rootkits and Trojans. [5]
7.
Briefly describe the status of cyber law in Nepal. [5]
8.
Discuss various methods of risk treatment during security risk analysis. [5]
9.
What is the use of S-box in DES? Illustrate S-box operation with an example. [5]
10.
How hash value is generated by the SHA-2 hash function. [5]
11.
Write Rabin Miller Algorithm for primality testing. Test whether 341 is prime or not using the algorithm. [5]
12.
Define interception, repudiation and incapacitation with examples. [5]