Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher

monarajput100 2,036 views 25 slides Dec 10, 2020
Slide 1
Slide 1 of 25
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25

About This Presentation

Information Security


Slide Content

Information Security
Mamoona Jabbar

Information Security
Topic: Cryptology Techniques

Types of Cryptosystem
1.SymmetrickeyEncryption
2.AsymmetrickeyEncryption

Cryptographic Systems -History
Beforeproceedingfurther,youneedtoknowsomefactsabouthistorical
cryptosystems
•Allofthesesystemsarebasedonsymmetrickeyencryptionscheme.
•Theonlysecurityservicethesesystemsprovideisconfidentialityof
information.
•Unlikemodernsystemswhicharedigitalandtreatdataasbinarynumbers,
theearliersystemsworkedonalphabetsasbasicelement.
TheseearliercryptographicsystemsarealsoreferredtoasCiphers.Ingeneral,a
cipherissimplyjustasetofsteps(analgorithm)forperformingbothan
encryption,andthecorrespondingdecryption.

Caesar Cipher
Itisamono-alphabeticcipherwhereineachletteroftheplaintextissubstituted
byanotherlettertoformtheciphertext.Itisasimplestformofsubstitution
cipherscheme.
ThiscryptosystemisgenerallyreferredtoastheShiftCipher.Theconceptisto
replaceeachalphabetbyanotheralphabetwhichis‘shifted’bysomefixed
numberbetween0and25.
Forthistypeofscheme,bothsenderandreceiveragreeona‘secretshiftnumber’
forshiftingthealphabet.Thisnumberwhichisbetween0and25becomesthe
keyofencryption.
Thename‘CaesarCipher’isoccasionallyusedtodescribetheShiftCipherwhen
the‘shiftofthree’isused.

Process of Shift Cipher
•Inordertoencryptaplaintextletter,thesenderpositionstheslidingruler
underneaththefirstsetofplaintextlettersandslidesittoLEFTbythe
numberofpositionsofthesecretshift.
•Theplaintextletteristhenencryptedtotheciphertextletteronthesliding
rulerunderneath.Theresultofthisprocessisdepictedinthefollowing
illustrationforanagreedshiftofthreepositions.Inthiscase,theplaintext
‘tutorial’isencryptedtotheciphertext‘WXWRULDO’.Hereisthecipher
textalphabetforaShiftof3:

Process of Shift Cipher
•Onreceivingtheciphertext,thereceiverwhoalsoknowsthesecretshift,
positionshisslidingrulerunderneaththeciphertextalphabetandslidesitto
RIGHTbytheagreedshiftnumber,3inthiscase.
•Hethenreplacestheciphertextletterbytheplaintextletteronthesliding
rulerunderneath.Hencetheciphertext‘WXWRULDO’ isdecryptedto
‘tutorial’.TodecryptamessageencodedwithaShiftof3,generatethe
plaintextalphabetusingashiftof‘-3’asshownbelow:

Process of Shift Cipher
SecurityValue
CaesarCipherisnotasecurecryptosystembecausethereareonly
26possiblekeystotryout.Anattackercancarryoutanexhaustive
keysearchwithavailablelimitedcomputingresources.

Simple Substitution Cipher
ItisanimprovementtotheCaesarCipher.Insteadofshiftingthe
alphabetsbysomenumber,thisschemeusessomepermutationofthe
lettersinalphabet.
Forexample,A.B…..Y.ZandZ.Y……B.Aaretwoobviouspermutation
ofallthelettersinalphabet.Permutationisnothingbutajumbledupset
ofalphabets.
With26lettersinalphabet,thepossiblepermutationsare26!(Factorial
of26)whichisequalto4x10
26
.Thesenderandthereceivermaychoose
anyoneofthesepossiblepermutationasaciphertextalphabet.This
permutationisthesecretkeyofthescheme.

Process of Substitution Cipher
•WritethealphabetsA,B,C,...,Zinthenaturalorder.
•Thesenderandthereceiverdecideonarandomlyselectedpermutationof
thelettersofthealphabet.
•Underneaththenaturalorderalphabets,writeoutthechosenpermutationof
thelettersofthealphabet.Forencryption,senderreplaceseachplaintext
lettersbysubstitutingthepermutationletterthatisdirectlybeneathitinthe
table.Thisprocessisshowninthefollowingillustration.Inthisexample,the
chosenpermutationisK,D,G,...,O.Theplaintext‘point’isencryptedto
‘MJBXZ’.
HereisajumbledCiphertextalphabet,wheretheorderoftheciphertextletters
isakey.

Process of Substitution Cipher
•Onreceivingtheciphertext,thereceiver,whoalsoknowstherandomly
chosenpermutation,replaceseachciphertextletteronthebottomrowwith
thecorrespondingplaintextletterinthetoprow.Theciphertext‘MJBXZ’is
decryptedto‘point’.
SecurityValue
SimpleSubstitutionCipherisaconsiderableimprovementovertheCaesar
Cipher.Thepossiblenumberofkeysislarge(26!)andeventhemodern
computingsystemsarenotyetpowerfulenoughtocomfortablylaunchabrute
forceattacktobreakthesystem.However,theSimpleSubstitutionCipherhasa
simpledesignanditispronetodesignflaws,saychoosingobviouspermutation,
thiscryptosystemcanbeeasilybroken.

Monoalphabetic and Polyalphabetic Cipher
Monoalphabeticcipherisasubstitutioncipherinwhichforagivenkey,the
cipheralphabetforeachplainalphabetisfixedthroughouttheencryption
process.Forexample,if‘A’isencryptedas‘D’,foranynumberofoccurrencein
thatplaintext,‘A’willalwaysgetencryptedto‘D’.
PolyalphabeticCipherisasubstitutioncipherinwhichthecipheralphabetfor
theplainalphabetmaybedifferentatdifferentplacesduringtheencryption
process.Thenexttwoexamples,playfairandVigenereCipherare
polyalphabeticciphers.

PlayfairCipher
thisscheme,
•Pairsoflettersareencrypted,insteadofsinglelettersasinthecaseofsimple
substitutioncipher
•Initiallyakeytableiscreated
•Thekeytableisa5×5gridofalphabetsthatactsasthekeyforencrypting
theplaintext
•Eachofthe25alphabetsmustbeuniqueandoneletterofthealphabet
(usuallyJ)isomittedfromthetableasweneedonly25alphabetsinsteadof
26.IftheplaintextcontainsJ,thenitisreplacedbyI

PlayfairCipher
Thesenderandthereceiverdeicideonaparticularkey,say‘tutorials’.Inakey
table,thefirstcharacters(goinglefttoright)inthetableisthephrase,excluding
theduplicateletters.Therestofthetablewillbefilledwiththeremainingletters
ofthealphabet,innaturalorder.Thekeytableworksouttobe;

Process of PlayfairCipher
First,aplaintextmessageissplitintopairsoftwoletters(digraphs).Ifthereisan
oddnumberofletters,aZisaddedtothelastletter.Letussaywewantto
encryptthemessage“hidemoney”.Itwillbewrittenas−
HIDEMONEYZ
•Therulesofencryptionare−
•Ifboththelettersareinthesamecolumn,taketheletterbeloweachone
(goingbacktothetopifatthebottom)

Process of PlayfairCipher
•HIDEMONEYZ
•Ifbothlettersareinthesamerow,takethelettertotherightofeachone
(goingbacktotheleftifatthefarthestright)
•Ifneitheroftheprecedingtworulesaretrue,formarectanglewiththetwo
lettersandtakethelettersonthehorizontaloppositecorneroftherectangle.

Process of PlayfairCipher
Usingtheserules,theresultoftheencryptionof‘hidemoney’withthekeyof
‘tutorials’wouldbe−
QCEFNUMFZV
DecryptingthePlayfaircipherisassimpleasdoingthesameprocessinreverse.
Receiverhasthesamekeyandcancreatethesamekeytable,andthendecrypt
anymessagesmadeusingthatkey.
SecurityValue
Itisalsoasubstitutioncipherandisdifficulttobreakcomparedtothesimple
substitutioncipher.Asincaseofsubstitutioncipher,cryptanalysisispossibleon
thePlayfaircipheraswell,howeveritwouldbeagainst625possiblepairsof
letters(25x25alphabets)insteadof26differentpossiblealphabets.
ThePlayfaircipherwasusedmainlytoprotectimportant,yetnon-criticalsecrets,
asitisquicktouseandrequiresnospecialequipment.

VigenereCipher
Thisschemeofcipherusesatextstring(say,aword)asakey,whichisthenused
fordoinganumberofshiftsontheplaintext.
Forexample,let’sassumethekeyis‘math’.Eachalphabetofthekeyis
convertedtoitsrespectivenumericvalue:Inthiscase,

Process of VigenereCipher
Forexample,let’sassumethekeyis‘point’.Eachalphabetofthekeyis
convertedtoitsrespectivenumericvalue:Inthiscase,
p→16,o→15,i→9,n→14,andt→20.
Thus,thekeyis:161591420.
ProcessofVigenereCipher
•Thesenderandthereceiverdecideonakey.Say‘point’isthekey.Numeric
representationofthiskeyis‘161591420’.
•Thesenderwantstoencryptthemessage,say‘attackfromsoutheast’.He
willarrangeplaintextandnumerickeyasfollows−
•Henowshiftseachplaintextalphabetbythenumberwrittenbelowitto
createciphertextasshownbelow−

Process of VigenereCipher
•Here,eachplaintextcharacterhasbeenshiftedbyadifferentamount–and
thatamountisdeterminedbythekey.Thekeymustbelessthanorequalto
thesizeofthemessage.
•Fordecryption,thereceiverusesthesamekeyandshiftsreceivedciphertext
inreverseordertoobtaintheplaintext.
SecurityValue
VigenereCipherwasdesignedbytweakingthestandardCaesarciphertoreduce
theeffectivenessofcryptanalysisontheciphertextandmakeacryptosystem
morerobust.ItissignificantlymoresecurethanaregularCaesarCipher.
Inthehistory,itwasregularlyusedforprotectingsensitivepoliticalandmilitary
information.Itwasreferredtoastheunbreakablecipherduetothedifficultyit
posedtothecryptanalysis.

Variants of VigenereCipher
SpecialcasesofVigenerecipher−
•Thekeywordlengthissameasplaintextmessage.Thiscaseiscalled
VernamCipher.ItismoresecurethantypicalVigenerecipher.
•Vigenerecipherbecomesacryptosystemwithperfectsecrecy,whichis
calledOne-timepad.

One-Time Pad
Thecircumstancesare:
•Thelengthofthekeywordissameasthelengthoftheplaintext.
•Thekeywordisarandomlygeneratedstringofalphabets.
•Thekeywordisusedonlyonce.
SecurityValue
LetuscompareShiftcipherwithone-timepad.
•ShiftCipher−EasytoBreak
•One-timePad−ImpossibletoBreak

One-Time Pad VS. Shift Cipher
Shift Cipher One-time Pad
EasytoBreak ImpossibletoBreak
Theentiremessagecouldhavehadashift
between1and25
Possiblekeysaredependonencryption
key,weencryptthename“point”witha
one-timepad.Itisa5lettertext
Itisaverysmallsize Longermessage
Itisveryeasytobruteforce Tobreaktheciphertextbybruteforce,
youneedtotryallpossibilitiesofkeys
andconductcomputationfor(26x26x
26x26x26)=26
5
=11881376times
However,witheachcharacternowhaving
itsownindividualshiftbetween1and26,
thepossiblekeysgrowexponentiallyfor
themessage.
thecomputationgrowsexponentially
witheveryadditionalalphabet.This
makesitcomputationallyimpossibleto
breaktheciphertextbybruteforce.

Substitution Technique
1.SubstitutionCipher
2.FairPlayCipher
SubstitutionCipher:
C=(p+k)mod26(Encryption)
C=(p-k)mod26(Decryption)
Where,
kisakey,Cisaletter,Xisencryptmessageletter,andmode26meanstotal
alphabets(0to25)
Theorem:
1<(lessthenequalto)k<(lessthenequalto)26
Example:Encryptthemessage“KHAN”whereCiphershiftkeyis19

Substitution Technique
FairPlay/PlayfairCipher:
Ablockof5*5
Instructions:
1.Divideplaintextinpairofletters.
2.Replacerepeatedletterinthepairwithdummyletter.
3.IfPairofplaintextareinsamerowthenreplacethemwithrightmostletter.
4.Iftheplaintextletterareinsamecolumnreplacethemwithbeneathletter.
5.Ifplaintextletterareindifferentrowandcolumnreplacethemdiagonally.