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

Cyb Assignment 2

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 views2 pages

Cyb Assignment 2

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

CYB106 Assignment

1. John sends the secret messages to Felix. If you were the Felix, decrypt each message and state the key used
in decrypting each.

i. XLMW MW JEGYPXC SJ GSQTYXMRK


Message: THIS IS FACULTY OF COMPUTING
Key: Shift -4 (shift backward by 4)

ii. UFYR GQ WMSP LYKC


Message: WHAT IS YOUR NAME
Key: Shift +2 (shift forward by 2)

iii. CN XNTQ VNQJ CHKHFDMSKX


Message: DO YOUR WORK DILLIGENTLY
Key: Shift +1 (shift forward by 1)

iv. JU JT B DSJF UP DIFBU JO BO FYBN


Message: IT IS A CRIME TO CHEAT IN AN EXAM
Key: Shift -1 (shift backward by 1)

v. FVB HYL HU HTHGPUN WLYZVU


Message: YOU ARE AN AMAZING PERSON
Key: Shift -7 (shift backward by 7)

2. For RSA key generation to encrypt and decrypt messages, the values of p, q, and e are chosen to be 3, 11
and 7 respectively; where e is a value that is greater than 1 but less than the computed Totient. Use this
information to answer the following questions:
i. Compute the Public key
n = p×q
n = 3×11 = 33
φ = (p-1) × (q-1)
φ = 2×10 = 20
GCD (7, 20) = 1 (correct)
Public Key = (e, n) = (7, 33)

ii. Compute the value of d used in determining the Private key


7×d = 1 (mod 20)
7×3 = 21 = 1 (mod 20)
Therefore d = 3

iii. Compute the Private key


Private key = (d, n) = (3, 33)

iv. Write the formula for encrypting plaintext M, hence use the Public key to encrypt if M = 2
C = Me (mod n)
For M = 2:
C = 27 (mod 33) = 128 (mod 33)
C = 29
v. Write the formula for decrypting the encrypted message C, hence use the Private key to decrypt C
M = Cd (mod n)
For C = 29:
M = 293 (mod 33)
M = 24389 (mod 33)
M=2
3. Given a plaintext in hexadecimal 133457799BBCDFF and initial permutation (IP) table

31 26 28 30 32 25 27 29
55 50 52 54 56 49 51 53
7 2 4 6 8 1 3 5
47 42 44 46 48 41 43 45
23 18 20 22 24 17 19 21
39 34 36 38 40 33 35 37
15 10 12 14 16 9 11 13
63 58 60 62 64 57 59 61

i. Convert it to 64 bits binary number


0000 0001 0011 0011 0100 0101 0111 0111 1001 1001 1011 1011 1100 1101 1111 1111
ii. Use the initial permutation (IP) table to rearrange the bits of the plaintext according to the table.
1 1 1 1 1 0 1 0
0 1 0 1 1 1 0 1
0 0 0 0 1 0 0 0
1 0 1 0 1 1 1 1
0 1 0 1 1 0 0 0
0 0 1 0 1 1 0 1
1 0 1 0 1 0 1 0
1 1 1 1 1 1 1 1

iii. Convert the 64-bit permutated to 56-bit by dropping off the 8th bit.
1111 1010 1011 1000 0010 0101 0111 0101 1000 0101 1010 1010 1111 1111

You might also like