Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

MID TERM SOLUTION

Q No. 1

K=80 mod 26 ≡2

Text E T A R V Q I T C R J A
x 4 19 0 17 21 16 8 19 2 17 9 0
k 2 2 2 2 2 2 2 2 2 2 2 2
x–k 2 17 24 15 19 14 6 17 0 15 7 24
C R Y P T O G R A P H Y

Q No. 2

Consider an affine cipher with the following function 𝐶(𝑥) = 𝑎 ∗ 𝑥 + 𝑏 𝑚𝑜𝑑 253, compute the
decryption function and key size
Decryption function

x=a ( C ( x )−b ) mod 253


−1

ϕ ( 253 )=10∗22=220

The key size is.

220∗253=55660

Q No. 3 (a)

(b) Evaluate with Fermat Theorem 2750 mod 41


MID TERM SOLUTION

ϕ ( 41 ) =40

750 mod 40=30

750 30
2 mod 41≡ 2 mod 41
5
2 mod 41 ≡32 ≡−9 mod 41
10
2 mod 41 ≡81 mod 41≡ 40
10
2 mod 41 ≡−1 mod 41
20
2 mod 41 ≡1 mod 41
30
2 mod 41 ≡−1 mod 41 ≡ 40

(c) Compute Φ (1189) and Φ (1029)


1189 = 29*41

ϕ ( 1189 ) =(28∗40)

ϕ ( 1189 ) =(1120)

1029 = 3 * 7 * 7 * 7

3
1029=3∗7
3 2
ϕ (1029)=2∗(7 −7 )

ϕ (1029)=2∗(294)

ϕ (1029)=588

Q No. 4

Ri=Li−1 ⊕ f (R i−1 ⊕ K i )

Li=Ri−1

i = 4,

R4 =L3 ⊕ f (R3 ⊕ K 4 )

L4 =R3
MID TERM SOLUTION

i = 3,

R3=L2 ⊕f (R2 ⊕ K 3)

L3=R2

i = 2,

R2=L1 ⊕ f (R 1 ⊕ K 2 )

L2=R1

i = 1,

R1=L0 ⊕ f (R0 ⊕ K 1)

L1=R0

You might also like