A shift cipher moves each character of a plaintext, k steps forword modulo the s
ID: 3832797 • Letter: A
Question
A shift cipher moves each character of a plaintext, k steps forword modulo the size of the plaintext. In general, the formula for a shift cipher is E(p) = p + k mod n where n is the size of the plaintext. Given the following plaintext with its associated numerical values and the fact that a shift cipher is being used, use brute force to decipher the following message and identify the key. CZGGJRJMGY Once you figured out the key for the shift cipher the decryption key is easy to find. The general formula is D(p) = p + -k mod n where -k is the additive inverse of k modulo n. With this information, dicpher the following message OCZEJPMIZTDNIJOAJMOCZNRDAOWPOAJMOCJNZRCJZIYPMZOJOCZZIY Encrypt the following message with the key from step 1: THE SECRET TO CREATIVITY IS KNOWING HOW TO HIDE YOUR SOURCE.Explanation / Answer
The encryption will processed like this,
For example key is 1, the word is CHEGG, then
E(p) = p + k mod n
E(C) = 2 + 1 mod n = 3 = D
E(C) = 7 + 1 mod n = 8 = I
E(C) = 4 + 1 mod n = 5 = F
E(C) = 6 + 1 mod n = 7 = H
E(C) = 6 + 1 mod n = 7 = H
Therefor the cipher text is “DIFHH” for plain text “CHEGG” with key 1.
1)
Given cipher is “CZGGJRJMGY”
The all possible plaintexts with brute force method is
Key Plaintext
+1 BYFFIQILFX
+2 AXEEHPHKEW
+3 ZWDDGOGJDV
+4 YVCCFNFICU
+5 XUBBEMEHBT
+6 WTAADLDGAS
+7 VSZZCKCFZR
+8 URYYBJBEYQ
+9 TQXXAIADXP
+10 SPWWZHCWO
+11 ROVVYGYBVN
+12 QNUUXFXAUM
+13 PMTTWEWZTL
+14 OLSSVDVYSK
+15 NKRRUCUXRJ
+16 MJQQTBTWQI
+17 LIPPSASVPH
+18 KHOORZRUOG
+19 JGNNQYQTNF
+20 IFMMPXPSME
+21 HELLOWORLD
+22 GDKKNVNQKC
+23 FCJJMUMPJB
+24 EBIILTLOIA
+25 DAHHKSKNHZ
By observing all the possible plain texts with brute force, with key 21, we got “HELLOWORLD” as appropriate plain text.
2)
The given cipher text is
“OCZEJPMIZTDNIJOAJMOCZNRDAOWPOAJMOCJNZRCJZIYPMZOJOCZZIY”
With key size +21, we got
“THE JOURNEY IS NOT FOR THE SWIFT BUT FOR THOSE WHO ENDURE TO THE END”
(NOTE: ignore spaces)
3)
Now we have plain text, we need to encrypt the plain text into cipher text.
The given plain text is “THE SECRET TO CREATIVITY IS KNOWING HOW TO HIDE YOUR SOURCE” as
With no spaces “THESECRETTOCREATIVITYISKNOWINGHOWTOHIDEYOURSOURCE”
Key size is +21.
The Cipher text is “OCZNZXMZOOJXMZVODQDOTDNFIJRDIBCJROJCDYZTJPMNJPMXZ”
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.