Midterm Solution
Midterm Solution
Fall 2021
Midterm
Oct. 13, 2021, 4:00pm-5:15pm
Name: ID#:
This is a close-book, close-notes exam. For this exam, you may use a calculator. All other
electronic devices (e.g., cellular phones, laptops, PDAs) are prohibited. If you have a cellular
phone, please turn it off prior to the start of the exam to avoid distracting other students. You can
bring a one-page handwritten cheatsheet (double-sided 8.5 by 5.5 inches).
The exam contains 5 questions for a total of 100 points. Please answer the questions in the spaces
provided. If you need additional space, use the back of the page on which the question is written
and clearly indicate that you have done so.
a. RC4 is a B cipher.
A. replay B. masquerade
C. confidentiality
D. authentication
𝑎𝑥 𝑚𝑜𝑑 𝑝= b
C. Given integers a and b and a large prime p, finding an integer x such that
a. What is the main difference between block cipher and stream cipher?
b. What is the main difference between symmetric key encryption and asymmetric key
encryption?
symmetric key encryption uses the same key for encryption and decryption
there are a pair of keys (public key and private key) used asymmetric key encryption. One
used for encryption, the other one used for decryption
c. Distinguish between passive attacks and active attacks. What are the various forms of
these two attacks?
Passive Attack: Make use of information, but not affect system resources, relatively hard to detect,
but easier to prevent
Active Attack: Alter system resources or operation, relatively hard to prevent, but easier to detect
Plaintext: N E T W O R K
Converted: 13 4 19 22 14 17 10
Key: C M P E C M P
Converted: 2 12 15 4 2 12 15
15 16 8 0 16 3 25
Ciphertext: P Q I A Q D Z
Solutions: PQIAQDZ
b. (5 points)
Using Playfair cipher (with keywords: LARGE) to Decrypt the message: AQUTENKQ
L A R G E
B C D F H
I/J K M N O
P Q S T U
V W X Y Z
AQ---WK
UT---TS
EN---GO
KQ---CK
Plaintext: wktsgock
3. Symmetric Key Encryption
Consider the ciphertext message, C = 0100011100. Assume the IV value is 1111. Show the
steps to Decrypt C if Cipher Feedback Mode with s=2 was used in encryption.
Plaintext: 1110110011
AddRoundKeys. State:
00 40 80 C0
10 50 90 D0
20 60 A0 E0
30 70 B0 F0
State:
63 09 CD BA
CA 53 60 70
B7 D0 E0 E1
04 51 E7 8C
c). Show the value of State after
ShiftRows. State:
63 09 CD BA
53 60 70 CA
E0 E1 B7 D0
8C 04 51 E7
Find the periods of the above two generators using seed x 0=1, respectively.
Which one appears more random to you?
following: n=33; e = 3; M = 3
YA=32mod 19=13
K= 2197 mod 19=12