0% found this document useful (0 votes)
5 views4 pages

CCS - Tutorial Problems

The document outlines various encryption methods including S-DES, Diffie-Hellman key exchange, RSA encryption and decryption, and elliptic curve cryptography. It provides detailed calculations for key generation, encryption, and decryption processes for each method. The results include ciphertexts and public keys, demonstrating the successful application of these cryptographic techniques.

Uploaded by

anchitaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

CCS - Tutorial Problems

The document outlines various encryption methods including S-DES, Diffie-Hellman key exchange, RSA encryption and decryption, and elliptic curve cryptography. It provides detailed calculations for key generation, encryption, and decryption processes for each method. The results include ciphertexts and public keys, demonstrating the successful application of these cryptographic techniques.

Uploaded by

anchitaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Using S-DES perform encryption for the given plain text and the key
PT = 10100101 Key = 0010010111. Find k1, K2 and CT.
Key generation:
P10: 3 5 2 7 4 10 1 9 8 6
O/P of P10: 1000010111
Shift: 00001 01111 (shifting 1 bit to right)
P8: 6 3 7 4 8 5 10 9
O/P of P8: 00101111  K1
O/P of Shift is passed again to Shift: 00100 11101 (shifting 2 bits to right)
O/P of P8: 11101010  K2

K1= 00101111
K2= 11101010

Encryption:
8 bit PT is passed to IP
IP: 2 6 3 1 4 8 5 7
O/P of IP: 0111 0100
Right half is passed to E/P.
E/P: 4 1 2 3 2 3 4 1
O/P of E/P: 00101000
O/P of E/P is XORed with K1.
O/P of XOR: 00000111
0000 0111
0 1 2 3 0 1 2 3
S0= 0 1 0 3 2 S1= 0 0 1 2 3
1 3 2 1 0 1 2 0 1 3
2 0 2 1 3 2 3 0 1 0
3 3 1 3 2 3 2 1 0 3
0000 0111
S0 S1
Combine 1st and 4th bit then 2nd 3rd bit.
S0 (00) (00) 0 0
S1 (01) (11) 1 3
S0: 00Intersection of 0th row, 0th column in S0101
S1: 13Intersection of 1st row, 3rd column in S1311
0111 is passed to P4
P4: 2 4 3 1
O/P of P4: 1110
XOR 1110 with Right half 0100 to get 1001
Combine 1001 and right half 0100
1001 0100
O/P of Switching function: 0100 1001
Use right half 1001
O/P of E/P: 1100 0011
XOR with K2 to get: 0010 1001
S0:00 S1:10
O/P: 0010
O/P of P4: 0010 is XORed with 0100
O/P of XOR: 0110
Combine this and right half to get: 0110 1001
It is passed to IP-1.
IP-1: 4 1 3 5 7 2 8 6
O/P of IP-1: 0011 0110.
Ans: CT: 00110110

2. By Deffie-Hellman key exchange, find the value of k and also prove that keys at
the sender and receiver are same. Given the values: Xa=3,Xb=6,q=7.

Ya=αXa mod q
=53 mod 7
=6.
Yb=αXb mod q
=56 mod 10
=1
Key exchange at a:
(Yb)Xa mod q
= 13 mod 7
=1.
Key exchange at b:
(Ya) Xb mod q
=66 mod 7
=1.
So the key exchanges at the 2 sides are the same.
3. Perform RSA encryption and decryption with p=3,q=11,e=7,M=5.

Key Generation:
n=pq
=3*11=33
Ø(n)=(p-1)(q-1)
=20
ed=k Ø(n)+1
7d=k Ø(n)+1
Put k=1
7d=20+1
d=21/7=3.
Public key KU= {7, 33}, KR= {3, 33}
Encryption:
C=Me mod n
=57 mod 33
C=14
Decryption:
M=Cd mod n
=143 mod 33
M=5.

4. Find the value of d with p=5,q=11,e=3,M=9.

n=pq=55
Ø(n)=(p-1)(q-1)
=40
ed=k Ø(n)+1
Put k=5
3d=5(40)+1
=201/3
d =67
KU={3,55}
KR={67,55}

5. Find the value of d with p=7,q=11,e=17,M=8.

n=77
Ø(n)=120
ed= kØ(n)+1
11d=k (120)+1
put k=1
11d=121
d=11
KU={11,143}
KR={11,143}
6. Using elliptic curve cryptography with G=(2,7),B`s secret key is nb=7,Pm=(10,9)
and k=3. Find (i) Public key of B, Pb (ii) Determine ciphertext Cm (iii) Decrypt
Cm from Pm.

(i) B`s public key Pb


Pb=nb*G
=7(2,7)
Pb=(14,49).
(ii) Encryption : Cm
Cm={kG,Pm+kPb}
={3(2,7),(10,9)+3(14,49)}
={(6,21),(10,9)+(42,147)}
Cm={(6,21),(52,156)}.
(iii) Decryption : Pm
Pm=Pm+kPb-nb(kG)
We have got Cm={(6,21),(52,156)}.So by theory,

=(52,156)-7(3*(2,7))
=(52,156)-7(6,21)
=(52,156)-(42,147)
=(10,9)
Pm=(10,9) is proved.

You might also like