Recent orders
Cyber Security Assignment ( Security and Cryptography)
Exercise 4: Security and Cryptography
Mark: 20%
A. What is Frequency Analysis?
B. Using Frequency Analysis technique, cryptanalyse the following ciphertext:
“dfi du cei tpwr du rdnsafm pf ifqkwxcig oirrpmi, au cei npfmvpmi du cei xnpafcizc ar lfdtf, ar cd uafg p
gauuikifc xnpafcizc du cei rpoi npfmvpmi ndfm ifdvme cd uann dfi reiic dk rd, pfg ceif ti qdvfc cei
dqqvkkifqir du ipqe niccik. Ti fdci pfg qpnn cei odrc ukijvifcnw dqqvkkafm niccik cei ‘uakrc’, cei fizc odrc
dqqvkkafm niccik cei ‘riqdfg’ cei udnndtafm odrc dqqvkkafm niccik cei ‘ceakg’, pfg rd df, vfcan ti pqqdvfc
udk pnn cei gauuikifc niccikr af cei xnpafcizc rpoxni. Ceif ti nddl pc cei qaxeik cizc ti tpfc cd rdnsi pfg ti pnrd
qnprrauw acr rwohdnr. Ti uafg cei odrc dqqvkkafm rwohdn pfg qepfmi ac cd cei udko du cei ‘uakrc’ niccik
du cei xnpafcizc rpoxni, cei fizc odrc qdoodf rwohdn ar qepfmig cd cei udko du cei ‘riqdfg’ niccik, pfg cei
udnndtafm odrc qdoodf rwohdn ar qepfmig cd cei udko du cei ‘ceakg’ niccik, pfg rd df, vfcan ti pqqdvfc
udk pnn rwohdnr du cei qkwxcdmkpo ti tpfc cd rdnsi”
Note: You are required to show and explain all the steps taken to deduce the plaintext. Marking criteria
for this task will mainly focus on the steps taken (which needs to be explained) rather than getting the
plaintext correct. Deducing the correct plaintext counts for only 20% of this exercise (4 marks) while the
steps taken and the knowledge shown count for 80% (16 marks). So, using an online tool to crack the
ciphertext won’t be that helpful.
The ciphertext doesn’t count in the word count
Cyber Security Assignment ( Python)
Exercise 3: Python
Mark: 20%
Alice and Bob need to individually and separately generate the same encryption (secret) key to allow them
to securely exchange a message (read about Diffie-Hellman key exchange). To do this, in this case, they both
need two public numbers (𝑝 = 353 and 𝛼 = 3). Alice calculates an individual public key (𝑌𝐴 = 40) and sends it
to Bob. Bob calculates an individual public key (𝑌B = 248) and sends it to Alice. To generate the secret key
(K), Alice and Bob would need their individual private keys (𝑋𝐴 and XB respectively) and the individual public
keys they received.
The relevant equations are:
𝑌𝐴 = ∝
𝑋𝐴 𝑚𝑜𝑑 𝑝
𝑌𝐵 = ∝
𝑋𝐵 𝑚𝑜𝑑 𝑝
𝐾𝐴 = 𝑌𝐵
𝑋𝐴 𝑚𝑜𝑑 𝑝 OR 𝐾𝐵 = 𝑌𝐴
𝑋𝐵 𝑚𝑜𝑑 𝑝
Write a python script that will crack (brute force) the values of 𝑋𝐴 and 𝑋𝐵 and use them to generate the
secret key (𝐾). You must comment your code and explain the steps. Deliverables include commented code
and screenshots showing the values (𝑋𝐴, 𝑋𝐵 and 𝐾) generated by the code.
Hint: You already know the values of (𝑝 = 353, 𝛼 = 3, 𝑌𝐴 = 40, and 𝑌B = 248). 𝑚𝑜𝑑 𝑝 means ‘modulus 𝑝‘
(check the mathematical notation for modulus). Your range is 1 to 𝑝 − 1, which means 1 – 352. You are
looking for the values of 𝑋𝐴 and 𝑋𝐵 such that 𝐾𝐴 = 𝐾𝐵.
____________________________________________________
