Historia
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.
Konsepti
Incryptography,Caesarcipher(English:Caesarcipher),orCaesarencryption,CaesarTransformandTransformEncryptionarethesimplestandmostwidelyknownencryptiontechnologies.Itisareplacementencryptiontechnologyinwhichalllettersintheplaintextareshiftedbackward(orforward)inthealphabetbyafixednumberandthenreplacedwithciphertext.Forexample,whentheoffsetis3,alllettersAwillbereplacedwithD,BwillbecomeE,andsoon.ThisencryptionmethodisnamedafterCaesarduringtheRomanRepublic,whenCaesarusedthismethodtocommunicatewithhisgenerals.
TheCaesarcipherisoftenusedasastepinothermorecomplexencryptionmethods,suchastheVirginiacipher.TheCaesarcipherisalsousedinthemodernROT13system.However,likeallencryptiontechnologiesthatusealphabetstoreplace,theCaesarcipherisveryeasytobecracked,andcommunicationsecuritycannotbeguaranteedinpracticalapplications.
TiettyCaesarsalasanannimi
Accordingtotheoffset,thereareseveralspecificCaesarpasswordnames:
PartialTheoffsetis10:Avocat(A→K)
Offsetis13:ROT13
Offsetis-5: Cassis(K6)
Offsetis-6: Kasetti(K7)
Salasanan murtaminen
Evenifaciphertextattackisused,theCaesarcipherisaveryeasyencryptionmethodtocrack.Theremaybetwosituationstoconsider:
(1)Theattackerknows(orguesses)thatasimplealternativeencryptionmethodisusedinthepassword,butisnotsurethatitistheCaesarpassword;
(2)Hyökkääjä tietää (arvaa), että keisarisalausta käytetään, mutta ei tiedä sen kumoamista.
Forthefirstcase,theattackercanusemethodssuchasfrequencyanalysisorpatternwordanalysistoimmediatelyseethepatternfromtheanalysisresults,andconcludethattheencryptorusestheCaesarcipher.
Forthesecondcase,thesolutionisevensimpler.SincethelanguagesencryptedbytheCaesarcipheraregenerallyalphabetictextsystems,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.
Esimerkki
ThereplacementmethodoftheCaesarcipheristoarrangetheplaintextandciphertextalphabets.TheciphertextlettersindicatethatbymovingtheplaintextalphabettotheleftorrightafixednumberLocation.Forexample,whentheoffsetisshiftedtotheleftby3(thekeyfordecryptionis3):
Selkeän tekstin aakkoset:ABCDEFGHIJKLMNOPQRSTUVWXYZ;
Salakirjoitusaakkoset:DEFGHIJKLMNOPQRSTUVWXYZABC.
Whenusing,theencryptorfindsthelocationofeachletterinthemessagethatneedstobeencryptedintheplaintextalphabet,andwritesdownthecorrespondingletterintheciphertextalphabet.Thepersonwhoneedstodecryptwilloperateinverselyaccordingtothepreviouslyknownkeytogettheoriginalplaintext.Forexample:
Selkeä teksti:THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG;
Salateksti: WKHTXLFNEURZQIRAXPSVRYHUWKHODCBGRJ.
Caesarciphercan salaus- ja salauksenpurkumenetelmä lasketaan myös matemaattisella kongruenssimenetelmällä. Korvaa ensin kirjaimet numeroilla,A=0,B=1,...,Z=25.Tällä hetkellä salausmenetelmä, jossa on offsetnis:
Salauksen purku on: