1

I am not sure how to get the key for the following Monoalphabetic Cipher question. This is a textbook question and I know the answer, but I juts dont know how they got the key.

Question:

Decrypt the following Cipher texts, and give the key.  (Note that the correct key is the En-
cryption key, so if F changes to H and F is the plaintext, then the key is “C”):

(a) YRRYAIYRMLAC (b) DOBXQPZELLI

Answer: a) Text:ATTACKATONCE Key = X b) Text: GREATSCHOOL Key = A

Can somone please explain to me how to determine the key?

Tom
  • 11
  • By texts it means just the two given words ((a) YRRYAIYRMLAC and (b) DOBXQPZELLI)? – MathematicianByMistake Apr 18 '16 at 14:32
  • 1
    Are you sure second case answer is A? Unless I misunderstand something, key A should give a trivial cipher (plaintext equals ciphertext). – Abstraction Apr 18 '16 at 14:44
  • The simple way is just to write down the 25 possible answers. If you write them one under the other (ie starting ZSSZBJZSNMBD, ATTACKATONCE) it doesn't take long - especially when they make it easy for you! – almagest Apr 18 '16 at 14:45

1 Answers1

0

Option (a): brute force. Write a program that prints all 26 variants, find one which is human-readable. For texts this short it's probably the best approach.

Option (b): automatic frequency analysis. Write a program that counts frequency of each letter, then takes typical frequencies for the language and finds a shift where difference between these two 26-component vectors is minimal. Works wonders for longer cyphers.

Option (c): bigrams (two-letter combinations). Take big enough text, write a program (yes, again) which counts all 2-letter combinations, and among each shift group (for example, "ab, bc, cd, de, ef, ..., za" is such group) finds the most frequent pair. Then take two or three shift groups where there's a major leader. Then, for the text, try finding a bigram of such group and try a key corresponding to the leader.

Abstraction
  • 2,482