Classic Cryptography

Introduction

This report analyses various encrypted texts using classical and modern cipher techniques. For each ciphertext, the process includes identifying the cipher, explaining the decryption process, providing plaintext and ciphertexts, and conducting frequency analysis where applicable. The study highlights systematic approaches and critical contextual reasoning to decrypt messages.

Classical Ciphers

Caesar Cipher

Ciphertext: Cqn xwuh ynabxw oxa fqxv cqn qxdbn fjb rw jwh fjh bynlrju fjb Jacqda Mnwc, jwm cqjc fjb xwuh knljdbn rc qjyynwnm cx kn cqn xwn qn urenm rw. Qn qjm urenm rw rc oxa jkxdc cqann hnjab, nena brwln qn qjm vxenm xdc xo Uxwmxw knljdbn rc vjmn qrv wnaexdb jwm raarcjkun. Qn fjb jkxdc cqrach jb fnuu, mjat qjranm jwm wnena zdrcn jc njbn frcq qrvbnuo. Cqn cqrwp cqjc dbnm cx fxaah qrv vxbc fjb cqn ojlc cqjc ynxyun jufjhb dbnm cx jbt qrv fqjc qn fjb uxxtrwp bx fxaarnm jkxdc. Qn fxatnm rw uxlju ajmrx fqrlq qn jufjhb dbnm cx cnuu qrb oarnwmb fjb j uxc vxan rwcnanbcrwp cqjw cqnh yaxkjkuh cqxdpqc. Rc fjb, cxx ʹ vxbc xo qrb oarnwmb fxatnm rw jmenacrbrwp. Rc qjmw'c yaxynauh anprbcnanm frcq Jacqda cqjc cqn lxdwlru fjwcnm cx twxlt mxfw qrb qxdbn jwm kdrum jw khyjbb rwbcnjm.

Cipher Identification: The ciphertext was identified as a Caesar cipher due to its frequency analysis revealed that the most frequent letter, “N”, likely corresponded to “E” in plain English. This is 9 letters shifted from “E”. By reversing the shift backwards by 9 the correct plain text is found.

Decryption Process: 1. The shift was determined to be –9 by comparing “N” with “E”. 2. Each letter in the cipher text was shifted back by 9 positions in the alphabet. 3. Example of decryption

o Ciphertext: “N” -> Plain Text “E”

o Ciphertext “O” -> Plain Text “F”

Frequency Analysis:

Key: Shift = -9

Plaintext: The only person for whom the house was in any way special was Arthur Dent, and that was only because it happened to be the one he lived in. He had lived in it for about three years, ever since he had moved out of London because it made him nervous and irritable. He was about thirty as well, dark haired and never quite at ease with himself. The thing that used to worry him most was the fact that people always used to ask him what he was looking so worried about. He worked in local radio which he always used to tell his friends was a lot more interesting than they probably thought. It was, too ʹ most of his friends worked in advertising. It hadn't properly registered with Arthur that the council wanted to knock down his house and build a bypass instead.

Substitution Cipher

Ciphertext: gemzgsvkt svf sqeajee sc catca jeqkt zsc djee, sqovkt zq lvka jaqqidjw vk. zsc fqeva dcvtsz ql zsc gjk ql qevyc qve djf j ticjzicjffmijkgc zq svx.sc djf catvkt vk zsc avicgzvqk ql zsc kcjicfz gqikci, vk zsc sqoczsjz zsc djee jiqmka zsc gqikci xvtsz qllci xqic vk zsc djw qlckzijkgcf zsjk zsvf qkc, dsvgs qllcica kqkc.zsc mkfzcjavkcff ql zsc hmveavkt'f levtsz xjac svx lcce fvgp dvzslcji, jka jlzci j fsqiz dsvec sc zqqp zsc zqdce liqx qmz ql svf sqeajeejka ava fqxczsvkt dvzs vz dsvgs qkgc jtjvk bmfzvlvca vzf fmoicxcoqfvzvqk vk zsc evfz ql mfclme zsvktf zq zjpc dvzs wqm dsck wqm svzgssvpc iqmka zsc tjejnw. sc omz vz qyci svf scja fq sc dqmeak'z sjyc zqfcc dsjz sc djf aqvkt.svf lccz catca jeqkt zsc tiqmka. svf qmzfziczgsca sjka catcajeqkt zsc djee.

Cipher Identification: Identified as a substitution cipher due to irregular character mapping and lack of uniform shifts.

Decryption Process: Frequency analysis was performed to map common ciphertext letters to their plaintext counterparts. For instance, cipher text “C” was mapped to plaintext “E” due to being the most common letter used in the alphabet. Now with E mapped the next step is to look for the most common trigrams such as “the” with 16 occurrences of “ZSC” it can be assumed it has been substituted from “the”. As the ciphertext has maintained the grammar used it can also be assumed that any letters ending after an apostrophe is most likely an s, which gives us ciphertext f substituted for s. Next looking at the most common two cipher characters found, 30 occurrences of “vk”, using bigrams to look for “in”. Which means next to check is the 3rd most common trigram “ing”.

Example mappings:

  • “sqxething” = something

  • “eaging” = edging

  • “nqone” = none

  • “onge” = once

  • “cjn” = can

Key: Substitution mapping based on frequency analysis with Bigrams and Trigrams.

Frequency Analysis:

Plaintext: CLUTCHING HIS HOLDALL HE EDGED ALONG THE WALL, HOPING TO FIND ADOORWAY IN. THE SOLID WEIGHT OF THE CAN OF OLIVE OIL WAS A GREATREASSURANCE TO HIM.HE WAS EDGING IN THE DIRECTION OF THE NEAREST CORNER, IN THE HOPETHAT THE WALL AROUND THE CORNER MIGHT OFFER MORE IN THE WAY OFENTRANCES THAN THIS ONE, WHICH OFFERED NONE.THE UNSTEADINESS OF THE QUILDING'S FLIGHT MADE HIM FEEL SICK WITHFEAR, AND AFTER A SHORT WHILE HE TOOK THE TOWEL FROM OUT OF HIS HOLDALLAND DID SOMETHING WITH IT WHICH ONCE AGAIN JUSTIFIED ITS SUPREMEPOSITION IN THE LIST OF USEFUL THINGS TO TAKE WITH YOU WHEN YOU HITCHHIKE ROUND THE GALABY. HE PUT IT OVER HIS HEAD SO HE WOULDN'T HAVE TOSEE WHAT HE WAS DOING.HIS FEET EDGED ALONG THE GROUND. HIS OUTSTRETCHED HAND EDGEDALONG THE WALL.

Vigenère Cipher

Ciphertext: SFNABJ PAQ TFHBFHEJWHZ PF TAAB IG H HMEUS IY YATPWR UGK VMSESGULJID JSCGMGVCWR WHUUVELS, ZEPUOEV ON UF OMSHG IY WSWSABA VSGYD SBX VVFJUKSX UF LLE KCOGKK SF XZUUIQ QEJFSFHCMNY GIFLOLEJS CGKAWTABWMSQ FEZWHW OAQ. TZSLX DSW A KCOGK ZI CGIFWU'L MMESXBHLILQ WXXULMFQ, DUKADC BWQUNZW LE VWXG'A CROO HBX AMRE "A ZYYA EC LWU CG QSKLSB VXAS" ENV DUKADC BWQUNZW XHW PUGK HPAQWHZ PL AEJS PXYQ XIJSX, TUV WOES GXTTIRK CZ BA OIRW DFTFARG AH CG AZVEW-- TINY LMMW, GIFL AR FGIL--YVMV, AFR MHTW MN S YCGK GJ PAS-YRLV V2, ESQB TJUSRVWHZ AG XHW OGHBFX OX GFXLH LE'V AUGHYID LC AKHT VEUSHMSQ. LE DOS, IHFXIFU BXHNMLQ WH MOW AEL OCK, HFH TJWYW MWILABA UPLW OX VCFZWPF LC MXL OLEJS BX TAKHL PY ABJX. WZSLXCWV HW HINJZID ZWGLLDJ, HW SHVVMRTWFYW H HEIF. OZMLJ E SZCLM DZMLW VY PVJOEV COM AZET LVCL DSW BWQUNZW MT OOM APK LAFR NAHL AAK VOKAARG. ZS MXLEID LC BTCW WPJOCGLV LIK KLBZL. LIK PUVR, LSO, OOM ABJXIFU, VNA ZI SGCH LHLMSXWYW OAQSWZZ MOSX HW KUL UGX BSRFR OMVT, TIN CBKX BJICLLV ENV O FBALPE KVUDLF, ES OVI PVMPDF'H VX? OW GOMZXG'A MRDWFMMHFH WZON T IMMLVWHZ DGYLV PY WVARG XZSBUY XHJCOZO LLE UZINKK. SN LVY HAZIR ZOHW, OW AOMZX AHNI BWSH T SAXTDS BTYV---TRWGMXK LS CGAY NW OMTZ OHR JGRVABWBUY IXHZUGHLMOF CZ APK SWF DLXZWRCW, GI AL VICARYW AZET ZS UGK LLE TICEKARG OSLX QMWT YCCGN LS HSJY MV SGCWDN XHUL OLVYK. OW POGYYW BH JRGA QALJI HW KUL SQMNY. O QTSD SF HOFX IMX SLOCGLV WTGBY LSSFS JCMX BH FEZWHW OAQ, TZS VNPDHIFU JKVHIR. ZS MXLEID LC VX ZLVELQBXK GYT GB MHTW WOJH IY SWHGW CL EPH AHAQB XELINVSX HBLAAJRM YVJ EBGIN MOJIE GF ZHBJ JEWH UES LLE OOS TYGYNV. WN PHK E HMBE HM LLE YFINUV MN OVCVO LLE HOLMF TYIDRCGN ZED ZOX BAK JOMBXTAASNK, OHW DZMCZ WN AHV XACSH TSGRG OWNA PLWEDT NH RWIP AHMXSX FOMBX MVYITZSL TA LLE TCNMVE INV. BYKCGYSDM, BX ZLSOV IJ TUV, WUVRYGSQ, POGYCGN GYT GJYK AZI EVUY, AL XILL BUNZWSUK KCMO NIRLWAH. OW TRWGMXK ZMMKSFY ISGK SUUBUKX TZS QTSD, AEL KCMO EMSL OHW ZOIAL. VCL OWED OOM LDAQMABA YYWISLMFX, IMX SGAYHUW MN ZWM LAGQAUV QTZ VSIFU NAL TYTLSLYSQ.

Cipher Identification: Nothing notable is found when using the typical frequency analysis so the next step is using the index of coincidence analysis for identification. “This allows us to take two copies of the cipher-text and line them both up against each other with different shifts and then count the number of times the same letter occurs in the same column. When the correct shift/key length is found then you will find a spike in this number” (https://crypto.soc.port.ac.uk/crypto/cryptoweb/ioc.html) and using this method, the key length is revealed to be 8.

Decryption Process: Using https://crypto.soc.port.ac.uk/crypto/cryptoweb/freq-vig.html, letter frequency analysis was performed on the Vigenère ciphertext by setting the key length to 8 and analysing each column individually (from 0 to 7). The two highest frequencies in each column were considered to address cases where “E”, the most common English letter, was not the highest frequency due to the length of text. Indexing starts at 0 because Vigenère decryption often involves computational processes that rely on arrays, which are typically zero-indexed in programming rather than starting from 1.

Working through the Vigenère table above, the decryption proceeded to result in the following:

Key: “SOUTHSEA”

Frequency Analysis:

Plaintext: ARTHUR LAY FLOUNDERING IN PAIN ON A PIECE OF RIPPED AND DISMEMBERED REINFORCED CONCRETE FLICKED AT BY WISPS OF PASSING CLOUD AND CONFUSED BY THE SOUNDS OF FLABBY MERRYMAKING SOMEWHERE INDISTINCTLY BEHIND HIM THERE WAS A SOUND HE COULDNT IMMEDIATELY IDENTIFY PARTLY BECAUSE HE DIDNT KNOW THE TUNE I LEFT MY LEG IN JAGLAN BETA AND PARTLY BECAUSE THE BAND PLAYING IT WERE VERY TIRED AND SOME MEMBERS OF IT WERE PLAYING IT IN THREE-FOUR TIME SOME IN FOUR-FOUR AND SOME IN A KIND OF PIEEYED R2 EACH ACCORDING TO THE AMOUNT OF SLEEP HED MANAGED TO GRAB RECENTLY HE LAY PANTING HEAVILY IN THE WET AIR AND TRIED FEELING BITS OF HIMSELF TO SEE WHERE HE MIGHT BE HURT WHEREVER HE TOUCHED HIMSELF HE ENCOUNTERED A PAIN AFTER A SHORT WHILE HE WORKED OUT THAT THIS WAS BECAUSE IT WAS HIS HAND THAT WAS HURTING HE SEEMED TO HAVE SPRAINED HIS WRIST HIS BACK TOO WAS HURTING BUT HE SOON SATISFIED HIMSELF THAT HE WAS NOT BADLY HURT BUT JUST BRUISED AND A LITTLE SHAKEN AS WHO WOULDNT BE HE COULDNT UNDERSTAND WHAT A BUILDING WOULD BE DOING FLYING THROUGH THE CLOUDS ON THE OTHER HAND HE WOULD HAVE BEEN A LITTLE HARD-PRESSED TO COME UP WITH ANY CONVINCING EXPLANATION OF HIS OWN PRESENCE SO HE DECIDED THAT HE AND THE BUILDING WERE JUST GOING TO HAVE TO ACCEPT EACH OTHER HE LOOKED UP FROM WHERE HE WAS LYING A WALL OF PALE BUT STAINED STONE SLABS ROSE UP BEHIND HIM THE BUILDING PROPER HE SEEMED TO BE STRETCHED OUT ON SOME SORT OF LEDGE OR LIP WHICH EXTENDED OUTWARDS FOR ABOUT THREE OR FOUR FEET ALL THE WAY AROUND IT WAS A HUNK OF THE GROUND IN WHICH THE PARTY BUILDING HAD HAD ITS FOUNDATIONS AND WHICH IT HAD TAKEN ALONG WITH ITSELF TO KEEP ITSELF BOUND TOGETHER AT THE BOTTOM END NERVOUSLY HE STOOD UP AND SUDDENLY LOOKING OUT OVER THE EDGE HE FELT NAUSEOUS WITH VERTIGO HE PRESSED HIMSELF BACK AGAINST THE WALL WET WITH MIST AND SWEAT HIS HEAD WAS SWIMMING FREESTYLE BUT SOMEONE IN HIS STOMACH WAS DOING THE BUTTERFLY

Transposition Ciphers

Transposition Ciphers rearrange the characters without altering their identity. Factorization and transposition columnar analysis were critical in deciphering the following ciphers.

Ciphertext: AIETVPSMHSNETEEAAODDDHRATSSFDDTREDIWIMYNETNAIEOONMCENROEIATDPAEMEOSTEDOICRMDAWLBAEDYSOANIEAGTTRSRWEAASSYENSYHEEUPIOGLTNTBDNUSFIEMATTRDIAE MTTAZAICWAALGCFUAOUSEANDCRHAESEPXTAENPFNOPMTMEOEBRSWLUTECOYRUWLEAIF RNHCIODEBESNPUCALLHBHABNPTRNFASHEIINXAAOOSELTOALSLNUFNNUTKSMYWHEERTDT TOPNFGRTCMREHIRYROOTIOTRDSNOEROYDMTCRDORNFTNUMADETHMYIAEENEEIAOKONF ENCNCBNNTFTOLSNSLPYETITESIOTATIUDRKIILUTLDURIHIPORELEEAUOANOUEPQTFANSDPM HAIWWETFODISSOREWAIGTFDKECTRMTRDAECEGOEYAUFHFCMSIEEDDICENEVFUHOTLLTCN SYOIATLANEPUGSIIDDLTMTDKPEUUHTTIORREBSVENEOITTLETUCRAZNEEOASNTHTIHEGRXEP AMFOGRIEAIAONDCEEVEDOXEFLAPHTEHAGCSUCNALVTPATRAREELLTAEOEOLBAEHONBEORR EERDTTCHHTLUSOWSITNVRTHCEAETEIOAIOUNEONENTSSTILSIISXEMOREDITGPRRAERWRUS PTSYESRLEANFSPIYHNLWDNILRDENGESGSISDEILHE

Cipher Identification: The Ciphertext of 735 characters suggested a transposition cipher due to the irregularity of the characters. Frequency analysis shows “E” is the most used, which means it’s likely to be a transposition cipher as the next has not been shifted.

Decryption Process: The length of 735 characters was factored to find possible columnar arrangements. The factors include:

  • 1 × 735 = (1, 735)

  • 3 × 245 = (3, 245)

  • 5 × 147 = (5, 147)

  • 7 × 105 = (7, 105)

  • 15 x 49 = (15, 49)

  • 21 x 35 = (21, 35)

Where the factors of 5 and 7 was chosen as it seemed the most likely and crackable based on the key length. By testing various columnar transposition keys, a key length of 5 was found to not be suitable as no plain English text was appearing. Moving onto the key length of 7 and the characters were instantly ordered in the correct arrangement producing readable plaintext. This was done by dividing the text into 7 columns of 105 bytes of characters, which were vertically arranged by taking the top 105 bytes and placing them into the first column, moving onto the second column with the next 105 bytes, and so on.

Key: A, B, C, D, E, F, G or 1, 2, 3, 4, 5, 6, 7

Frequency Analysis:

Plaintext: AND TO THIS END THEY BUILT THEMSELVES A STUPENDOUS SUPER COMPUTER WHICH WAS SO AMAZINGLY INTELLIGENT THAT EVEN BEFORE THE DATA BANKS HAD BEEN CONNECTED UP IT HAD STARTED FROM I THINK THEREFORE I AM AND GOT AS FAR AS THE EXISTENCE OF RICE PUDDING AND INCOME TAX BEFORE ANYONE MANAGED TO TURN IT OFF IT WAS THE SIZE OF A SMALL CITY ITS MAIN CONSOLE WAS INSTALLED IN A SPECIALLY DESIGNED EXECUTIVE OFFICE MOUNTED ON AN ENORMOUS EXECUTIVE DESK OF FINEST ULTRA MAHAGONY TOPPED WITH RICH ULTRA RED LEATHER THE DARK CARPETING WAS DISCREETLY SUMPTUOUS EXOTIC POT PLANTS AND TASTEFULLY ENGRAVED PRINTS OF THE PRINCIPAL COMPUTER PROGRAMMERS AND THEIR FAMILIES WERE DEPLOYED LIBERALLY ABOUT THE ROOM AND STATELY WINDOWS LOOKED OUT UPON A TREE LINED PUBLIC SQUARE ON THE DAY OF THE GREAT ON TURNING TWO SOBERLY DRESSED PROGRAMMERS WITH BRIEF CASES ARRIVED AND WERE SHOWN DISCREETLY INTO THE OFFICE

Previous
Previous

Modern Cryptography

Next
Next

Home Lab