Caesar Code

ThesynonymCaesarpasswordgenerallyreferstotheCaesarpassword.

History

AccordingtoSuvitonius’records,Caesarusedthismethodtoencryptimportantmilitaryinformation:

Ifyouneedtokeepitsecret,useapasswordintheletter,thatis,changethealphabeticalordersothatoutsiderscannotformaword.Ifyouwanttoreadandunderstandtheirmeaning,youhavetoreplacethefirstletterwiththefourthletter,thatis,replaceAwithD,andsoon.

Similarly,Augustusalsousedasimilarmethod,exceptthathemovedtheletteroneplacetotheright,andtheenddidnotturnback.Wheneverhewritesinasecretlanguage,heusesBforAandCforB.Therestofthelettersfollowthesamerules;heusesAforZ.

Inaddition,thereisevidencethatCaesarhasusedamorecomplexcryptographicsystem:grammaristProbusoncewroteauniqueandinnovativemanuscript,studyingthesecretscontainedinCaesar’slettersLettersofinformation.

IthasbeenimpossibletofigureouthoweffectivetheCaesarcipherwasatthetime,buttherearereasonstobelievethatitissafe.BecausemostofCaesar'senemiesareilliterate,andtherestmayregardthesenewsasanunknownforeignlanguage.EvenifanenemyobtainedtheencryptedinformationofCaesar,accordingtotheexistingrecords,therewasnotechnologyatthattimetosolvethismostbasicandsimplereplacementpassword.Theearliestsurvivingmethodofcrackingisrecordedinthe9thcenturyArabbookbyAlKendiontheanalysisofthefrequencyofdiscovery.

Concept

Incryptography,Caesarcipher(English:Caesarcipher),orCaesarencryption,CaesarTransformandTransformEncryptionarethesimplestandmostwidelyknownencryptiontechnologies.Itisareplacementencryptiontechnologyinwhichalllettersintheplaintextareshiftedbackward(orforward)inthealphabetbyafixednumberandthenreplacedwithciphertext.Forexample,whentheoffsetis3,alllettersAwillbereplacedwithD,BwillbecomeE,andsoon.ThisencryptionmethodisnamedafterCaesarduringtheRomanRepublic,whenCaesarusedthismethodtocommunicatewithhisgenerals.

TheCaesarcipherisoftenusedasastepinothermorecomplexencryptionmethods,suchastheVirginiacipher.TheCaesarcipherisalsousedinthemodernROT13system.However,likeallencryptiontechnologiesthatusealphabetstoreplace,theCaesarcipherisveryeasytobecracked,andcommunicationsecuritycannotbeguaranteedinpracticalapplications.

SpecificCaesarpasswordname

Accordingtotheoffset,thereareseveralspecificCaesarpasswordnames:

  • PartialTheoffsetis10:Avocat(A→K)

  • Theoffsetis13:ROT13

  • Theoffsetis-5:Cassis(K6)

  • Theoffsetis-6:Cassette(K7)

PasswordCracking

Evenifaciphertextattackisused,theCaesarcipherisaveryeasyencryptionmethodtocrack.Theremaybetwosituationstoconsider:

(1)Theattackerknows(orguesses)thatasimplealternativeencryptionmethodisusedinthepassword,butisnotsurethatitistheCaesarpassword;

(2)Theattackerknows(orguesses)thattheCaesarcipherisused,butdoesnotknowitsoffset.

Forthefirstcase,theattackercanusemethodssuchasfrequencyanalysisorpatternwordanalysistoimmediatelyseethepatternfromtheanalysisresults,andconcludethattheencryptorusestheCaesarcipher.

Forthesecondcase,thesolutionisevensimpler.Sincethelanguages​​encryptedbytheCaesarcipheraregenerallyalphabetictextsystems,theoffsetthatmaybeusedinthepasswordisalsolimited.Forexample,whenusing26-letterEnglish,itsoffsetisupto25(offset26isequivalenttooffset0,thatis,plaintext;iftheoffsetexceeds26,itisequivalenttooffset1-25).Therefore,itcanbeeasilycrackedbyexhaustivemethods.Oneofthemethodsistowritedownasmallfragmentoftheciphertextinthetableanduseallpossibleoffsetstodecryptthecontent-calledcandidateplaintext,andthenanalyzewhetherthecandidateplaintextinthetablehasactualmeaning,andgetthecorrectOffset,decrypttheentireciphertext.Forexample,theselectedciphertextfragmentis"EXXEGOEXSRGI".Fromthecandidateplaintextinthetableontheright,wecanquicklyseethatthecorrectoffsetis4.Itisalsopossibletowritedowntheotherlettersoftheentirealphabetverticallyundereachletterofeachciphertextword,andthenthroughanalysis,itcanbeconcludedthatoneofthelinesisplaintext.

Anothermethodofattackisthroughfrequencyanalysis.Whenthelengthoftheciphertextislargeenough,thefrequencyofeachletterintheciphertextcanbeanalyzedfirst,andthenthisfrequencycanbecomparedwiththefrequencyofoccurrenceofalllettersinthelanguagealphabetundernormalcircumstances.Forexample,inEnglish,thefrequencyofthelettersEandTinnormalplaintextisparticularlyhigh,whilethefrequencyofthelettersQandZisparticularlylow.InFrench,themostfrequentletterisE,andthelowestisKandW.Thisfeaturecanbeusedtoanalyzethefrequencyofciphertextletters,andthecorrectoffsetcanbeestimated.Inaddition,sometimesthefrequencyanalysiscanbeextendedfromletterstowords.Forexample,inEnglish,themostfrequentlyoccurringwordsare:the,of,and,a,to,in...Wecananalyzeitbycompilingallpossible25groupsofciphertextsofthemostcommonwordsintoadictionary.Forexample,QEBmaybethe,andMPQYmaybethewordknow(ofcourseitmayalsobeaden).However,frequencyanalysisalsohasitslimitations.Itisnotsuitablefordecryptingciphertextsthatareshortordeliberatelyomittedvowelsorotherabbreviations.

Inaddition,usingtheCaesarciphermultipletimestoencryptcannotachievegreatersecurity,becausetheresultobtainedbyusingoffsetAtoencryptandthenusingoffsetBtoencryptisequivalenttousingA+TheoffsetofBistheresultofencryption.

Example

ThereplacementmethodoftheCaesarcipheristoarrangetheplaintextandciphertextalphabets.TheciphertextlettersindicatethatbymovingtheplaintextalphabettotheleftorrightafixednumberLocation.Forexample,whentheoffsetisshiftedtotheleftby3(thekeyfordecryptionis3):

Plaintextalphabet:ABCDEFGHIJKLMNOPQRSTUVWXYZ;

Ciphertextalphabet:DEFGHIJKLMNOPQRSTUVWXYZABC.

Whenusing,theencryptorfindsthelocationofeachletterinthemessagethatneedstobeencryptedintheplaintextalphabet,andwritesdownthecorrespondingletterintheciphertextalphabet.Thepersonwhoneedstodecryptwilloperateinverselyaccordingtothepreviouslyknownkeytogettheoriginalplaintext.Forexample:

Plaintext:THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG;

Ciphertext:WKHTXLFNEURZQIRAMXPSVRYHUWKHODCBGRJ.

TheencryptionanddecryptionmethodsoftheCaesarciphercanalsobecalculatedbythemathematicalmethodofcongruence.First,replacetheletterswithnumbers,A=0,B=1,...,Z=25.Atthistime,theencryptionmethodwithoffsetnis:

Decryptionis:

Related Articles
TOP