[go: up one dir, main page]

0% found this document useful (0 votes)
263 views2 pages

CRY303c PE Solution Spring22

This document contains 10 questions about various cryptography concepts and algorithms including: 1) Euler's theorem and totient functions 2) Caesar cipher encryption and decryption 3) Permutation cipher encryption 4) Extended Euclidean algorithm 5) Diffie-Hellman key exchange 6) Number of keys needed for virtual machine communication
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)
263 views2 pages

CRY303c PE Solution Spring22

This document contains 10 questions about various cryptography concepts and algorithms including: 1) Euler's theorem and totient functions 2) Caesar cipher encryption and decryption 3) Permutation cipher encryption 4) Extended Euclidean algorithm 5) Diffie-Hellman key exchange 6) Number of keys needed for virtual machine communication
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
You are on page 1/ 2

Q1)

Euler’s Theorem: If n ≥ 1 and GCD(a,n) = 1 then a^totient(n) ≡ 1(mod n)


totient(377) =336
69^673 mod 377 = ((69^336)^2 * 69) mod 377
= (( (69^336)^2 mod 377 )*( 69 mod 377 )) mod 377
= (1*69) mod 377 = 69

Q2)
- The English alphabet:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

- Caesar cipher decrypt with a key k = 7:


Formula: p = ( x-k ) mod 26

A = (0-7) mod 26 = 19 ---> T


O = (14 - 7) mod 26 = 7 ----> H
B = (1 - 7) mod 26 = 20 ---> U
Y = (24-7) mod 26 = 17 ---> R
K = (10 - 7) mod 26 = 3 ---> D
H = (7-7 ) mod 26 = 0 ---> A
F = (5-7) mod 26 = 24 ---> Y
----> The plain text of AOBYKHF is THURDAY

Q3)
- Because the formula of decryption Caesar cipher is:
p = (x -k) mod 26
---> If forgot the key, after 26 times rotated the text will come right back to the
original.

Q4)
- Permutation Cipher with a key:
4 2 1 3
S E E Y
O U A T
T H E L
I B R A
R Y
---> Write cipher text of SEEYOUATTHELIBRARY by write letters each column
following the order of key 1 -> 2 -> 3 -> 4: EAEREUHBYYTLASOTIR

Q5)
108 = 2^2 * 3^3
totient(108) = 108*(1-1/2)*(1-1/3) = 36

Q6)
p = 5 , q=13 , e=5
n=p*q=5*13 = 65
---> totient(65) = (p-1)*(q-1) = 4*12 = 48
Q7)
p=5 , q=13 , e=5 , d=29 , M=17
---> n = 5*13 = 65
---> totient(65) = (p-1)*(q-1) = 4*12 = 48
- Formula of Extended Euclidean algorithm:
Encryption: C = M^e mod n
---> C = 17^5 mod 65
= (17^2 * 17^2 * 17) mod 65
= ((17^2 mod 65) * (17^2 mod 65) * (17 mod 65)) mod 65
= (29*29*17) mod 65
= 62

Q8)
p=5 , q=13 , e=5 , C=19 , m’ = 32
n = p*q = 13*5 = 65
c’ = c*r^e mod n choose the ciphertext 19*243 mod 65 = 2
---> r =√5 243 = 3
m’ = m*r mod n ---> 32 = m*3 mod 65 --->m =54

Q9)
Y_A=3 , a=2 , p=13
- Use formula Diffie-Hellman Key Exchange:
Y_A = a^X_A mod p
3 = 2^X_A mod 13
---> X_A = 4

Q10)
- Suppose n is called as the number of all VM’s.
- Because there are 8 computers (hardware), each computer hosts 4 virtual
machines (VM) with different addresses:
---> n = 8*4 = 32 (VM’s)
---> We need (n*(n-1))/2 keys for n VM’s = (32*31)/2 = 496 key exchange sessions

You might also like