Intro to Cryptanalysis#

Throughout this course you’ll discover and implement a variety of sophisticated methods to determine a plaintext from a given ciphertext. However, you’re already equipped with years of knowledge about the English language that will be essential to your work.

For example, you may have used some of the following patterns in the ciphertext to help you make guesses about the plaintext:

  • The fragement FZW appeared several times, making it a common 3-letter world.

  • The ciphertext letter Q appears as a 1-letter world, likely meaning the plaintext letter it corresponds to is A or I

  • The ciphertext letter A appears at the start of several 2-letter words, so the corresponding plaintext letter is likely a vowel

After a few guesses, you likely saw complete or partial words starting to appear in your work. For example, suppose you guessed that the ciphertext letters FZH corresponded to the plaintext letters the. Substituting letters from the ciphertext for their corresponding plaintext letters yields the following partial decryption:

the GBYe tA VSDUAJeB DeUBetD SD VeeTEO SMYBQSMeV SM hGNQM MQtGBe; eJeM the EeQDt UGBSAGD NSMV SD BAGDeV RO the TBANSDe AX DhQBSMY IMAKEeVYe KSthheEV XBAN AtheBD. DANe QBe XABtGMQte eMAGYh tA XSMV Q CAR KhSUh UAMDSDtD SM the DAEGtSAM AX NODteBSeD, KhetheB St Re the ThODSUSDt KhA tBQUID VAKM Q hStheBtA GMIMAKM MGUEeQB TQBtSUEe AB the TAESUeNQM KhA VeteUtD Q UBSNSMQE. RGt NADt AX GD QBe VBSJeM tA DGRESNQte thSD GBYe RO the DAEJSMY AX QBtSXSUSQE TGPPEeD VeJSDeV XAB AGB eMteBtQSMNeMt. VeteUtSJe DtABSeD AB UBADDKABV TGPPEeD UQteB XAB the NQCABStO; the DAEGtSAM AX DeUBet UAVeD NQO Re the hARRO AX the XeK.

-CAhM UhQVKSUI

You may notice the short 2-letter word, tA, that starts with a lowercase t. There are very few 2-letter words that start with t and to seems more likely than the others. So, you guess that the ciphertext letter A corresponds to plaintext letter o and decrypt the message a little bit further:

the GBYe to VSDUoJeB DeUBetD SD VeeTEO SMYBQSMeV SM hGNQM MQtGBe; eJeM the EeQDt UGBSoGD NSMV SD BoGDeV RO the TBoNSDe oX DhQBSMY IMoKEeVYe KSthheEV XBoN otheBD. DoNe QBe XoBtGMQte eMoGYh to XSMV Q CoR KhSUh UoMDSDtD SM the DoEGtSoM oX NODteBSeD, KhetheB St Re the ThODSUSDt Kho tBQUID VoKM Q hStheBto GMIMoKM MGUEeQB TQBtSUEe oB the ToESUeNQM Kho VeteUtD Q UBSNSMQE. RGt NoDt oX GD QBe VBSJeM to DGRESNQte thSD GBYe RO the DoEJSMY oX QBtSXSUSQE TGPPEeD VeJSDeV XoB oGB eMteBtQSMNeMt. VeteUtSJe DtoBSeD oB UBoDDKoBV TGPPEeD UQteB XoB the NQCoBStO; the DoEGtSoM oX DeUBet UoVeD NQO Re the hoRRO oX the XeK.

-CohM UhQVKSUI

At this point you decide to keep track of the mapping between ciphertext letters and their corresponding plaintext letters.

 plaintext: a b c d e f g h i j k l m n o p q r s t u v w x y z 
ciphertext: - - - - W - - Z - - - - - - - - - - - F - - - - - -

Now maybe you guess that the last line is a signature since it’s separated by a line and marked with a hyphen. It seems like the first name could be John, which would give you two more letters.

 plaintext: a b c d e f g h i j k l m n o p q r s t u v w x y z 
ciphertext: - - - - W - - Z - C - - - M A - - - - F - - - - - -

the GBYe to VSDUoJeB DeUBetD SD VeeTEO SnYBQSneV Sn hGNQn nQtGBe; eJen the EeQDt UGBSoGD NSnV SD BoGDeV RO the TBoNSDe oX DhQBSnY InoKEeVYe KSthheEV XBoN otheBD. DoNe QBe XoBtGnQte enoGYh to XSnV Q joR KhSUh UonDSDtD Sn the DoEGtSon oX NODteBSeD, KhetheB St Re the ThODSUSDt Kho tBQUID VoKn Q hStheBto GnInoKn nGUEeQB TQBtSUEe oB the ToESUeNQn Kho VeteUtD Q UBSNSnQE. RGt NoDt oX GD QBe VBSJen to DGRESNQte thSD GBYe RO the DoEJSnY oX QBtSXSUSQE TGPPEeD VeJSDeV XoB oGB enteBtQSnNent. VeteUtSJe DtoBSeD oB UBoDDKoBV TGPPEeD UQteB XoB the NQjoBStO; the DoEGtSon oX DeUBet UoVeD NQO Re the hoRRO oX the XeK.

-john UhQVKSUI

You can see how word length and punctuation give away a great deal of information about the plaintext message. Only a few more guesses eventually reveals the full mapping from plaintext to ciphertext letters:

 plaintext: a b c d e f g h i j k l m n o p q r s t u v w x y z 
ciphertext: Q R U V W X Y Z S C I E N M A T H B D F G J K L O P

When a single plaintext letter is mapped to a single ciphertext letter, the process is called enciphering. The particular method used to create the mapping is called a cipher. To reverse the enciphering process you decipher a message. There are many ways you can map plaintext letters to ciphertext letters.