Professional Documents
Culture Documents
NETWORKS SECURITY
Midterm Exam Solutions - Spring 2016
QUESTION 1.A
The set of keys and enciphering algorithm should be free from complexity.
Errors in ciphering should not propagate and cause corruption of further information in the message.
one error should not throw off the entire process
The size of the enciphered text should be no larger than the text of the original message.
QUESTION 2.A
Choose p = 5 and q = 7
Compute n = p × q = 5 × 7 = 35
Compute 𝝋(n) = (p -1) × (q -1) = 4 × 6 = 24
Choose e such that 1 < e < 𝜑(n) & e and 𝜑(n) are coprime [ gcd( 𝝋(n), e ) = 1 ]. Let e = 7
Compute a value for d such that (d × e) % 𝜑(n) = 1. One solution is d = 31 [(31 × 7) % 24 = 1]
Public key is (e, n) (7, 35)
Private key is (d, n) (31, 35)
The encryption of m = 2 is c = ( 𝑚𝑒 mod n ) = 27 % 35 = 23
The decryption of c = 23 is m = ( 𝑐 𝑑 mod n ) = 23 𝟑𝟏 % 35 = 2
QUESTION 2.B
Intermediate Ciphertext
A T T A C K A T 1 2 0 0 A M
DV DG DG DV FA FX DV DG AA XA VX VX DV DD
X 2 3 5 6 8 9 X V X D V D D
Plaintext = “ATTACK AT 1200AM” Ciphertext = “DXXV GDAD DAAX DVDX VFGV GFAD DVVD”