0% found this document useful (0 votes)
6 views5 pages

CRY303c PE

The document outlines the steps to decode a PIN code using RSA encryption, including finding n, ϕ(n), and the secret key d, ultimately revealing the PIN as 111. It also describes the decryption of a Caesar cipher with a key of 3, resulting in the plaintext 'ILOVEYOU'. Additionally, it covers various cryptographic calculations and concepts, including shared secret keys and the number of virtual machines (VMs) and key exchange sessions required in a network setup.

Uploaded by

tiendat3808
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)
6 views5 pages

CRY303c PE

The document outlines the steps to decode a PIN code using RSA encryption, including finding n, ϕ(n), and the secret key d, ultimately revealing the PIN as 111. It also describes the decryption of a Caesar cipher with a key of 3, resulting in the plaintext 'ILOVEYOU'. Additionally, it covers various cryptographic calculations and concepts, including shared secret keys and the number of virtual machines (VMs) and key exchange sessions required in a network setup.

Uploaded by

tiendat3808
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/ 5

Q1:

To decode the PIN code, follow these steps:


1. Find n and ϕ(n):
- n = 221
- p = 17, q = 221/17 = 13
- ϕ(n) = (17 - 1) * (13 - 1) = 16 * 12 = 192
2. Find the secret key d:
Find D so that d * E ( mod ϕ(n)) = 1
- d * 5 ( mod 192 )
- Applying the Extended Euclidean Algorithm:
- Solve 5 ≡ 1 mod 192
- 192 = 5 * 38 +2
- 5=2*2+1
- Back-substitute:
- 1 = 5 - 2 *2
- 2 = 192 - 5 * 38
- Substitute 2:
- 1 = 5 - (192 - 5 * 38) *2
- 1 = 5 * 77 - 192 * 2
So, d = 77
3. Decoding the cipher text:
- Use the private key d=77 to decrypt the cipher-text 76
X = 76 ^ d mod n
X = 76 ^ 77 mod 221
X = 111
Pin code is 111

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 = 3:


Formula: p = (x-k) mod 26

L = (11-3) mod 26 = 8 ---> I


O = (14-3) mod 26 = 11 ---> L
R = (17-3) mod 26 = 14 ---> O
Y = (24-3) mod 26 = 21 ---> V
H = (7-3) mod 26 = 17 ---> E
B = (1-3) mod 26 = 9 ---> Y
R = (17-3) mod 26 = 19 ---> O
X = (23-3) mod 26 = 20 ---> U

----> The plain text of LỎYHBRX is ILOVEYOU

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:
12:It
34:logs
18:of
48:vivid
16:expensive
10:yellow
18:of
2:upon
So, the decrypted message is "Iloveyou"

Q5:
605 = 5 * 11^2
Totient(605) = 605 * (1-1/5)*(1-1/11) = 440

Q6:
p = 5, q = 11, e = 7, n = p*q
Totient(n)=Totient(5*11) = totient(55) = (p-1) * (q-1) = 40
C = M^e mod n
C= 17^7 mod 55 = 8

Q7:
Alice’s public value A is computed as:
A = g^a mod p = 5^11 mod 79 = 42
Bob’s public value B is computed as:
B = g^b mod p = 5^7 mod 79 = 73
The shared secret key K can be computed by:
K = B^a mod p or A^b mod p
K = 73^11 mod 79 or 42^7 mod 79
K = 16

Q8:
Alice’s public value A is calculated as:
A = g^a mod p = 5^11 mod 79 = 42
K’ =(B’)^a mod p = 23^11 mod 79 = (5) = 55

23^11 = 23^8 * 23^2 * 23


(1) 23^8 mod 79 = 55
(2) 23^2 mod 79 = 55
(3) 23 mod 79 = 23

(4) = (1)*(2) mod 79 = 55*55 mod 79 = 23


(5) = (4)*(3) mod 79 = 23*23 mod 79 = 55

So, the new shared secret key K’ is 55

Q9:

- Suppose n is called as the number of all VM’s.


- Because there are 12 computers (hardware), each computer hosts 6 virtual machines (VM) with different
addresses and each VM hosts 10 applications:
---> n = 12*6 = 72 (VM’s)
---> We need (n*(n-1))/2 keys for n VM’s = (72*71)/2 = 5112 key exchange sessions

You might also like