You are on page 1of 55

EncryptionOverviewand EncryptionTechniques

AquickQuiz
Whatarethethree majorsecuritygoals? Whatgoalarewegoingtorefertotoday?

SomeAdmin
Reminderthat Mon16:00CB10.03.240willrun wehave increaseinstudentscomingtothisclass. Pleasestaywithinyourallocatedtutorial class,atleastforthefirstfewclasses. (tutorialsareallfull). Tutorialquestionscanbedownloadedfrom UTSOnline Answerswillbeputuplaterthisweek.

Moreadmin
Alittleannouncement: StaytunedforQuiz1details.

LectureOutline
EncryptionBasics SimpleEncryption CaesarandVigenere Ciphers ComputersandEncryption EncryptionTechniques CryptoanalyticAttacks

EncryptionandSecurityGoals

Encryptionisusedtoprovide confidentiality.

Definitions
Encryption:aprocessoftransformingdatausingan algorithmsothatdataisnolongerrecognisable,andat thesametime,recoverable.

3Importantinputs:
Plaintext :messagetobeencrypted,orcallitcleartext. EncryptionKey :Anotherinput totheEncryptionalgorithmthat determinestheoutputofthealgorithmforaspecificplaintext. EncryptionAlgorithm :Thesetofprocedureswithplaintext and encryptionkey asinputsandtheencryptedplaintext(ciphertext)as output.

EncryptionandDecryption

Terms
Ciphertext :Encrypteddata outputofencryption algorithmandinputofdecryptionalgorithm. SymmetricEncryption:Anencryptionmethodwhere encryptionkeyandthedecryptionkeyarethesame. AsymmetricEncryption :Anencryptionmethod wheretheencryptionkeyanddecryptionkeyare differentalsoknownasPublicKeyEncryption.

Cryptology

Bletchley Park

SymmetricEncryption

Why dont we just send the message in a secure channel?

AsymmetricEncryption

The public and private key pair must be mathematically related!

HistoricalContextofencryption
Encryptionhasbeenusedforhundredsof years. Averysimple(andeasilybreakable)method ofencryptionistheCaesarCipher. Aslightlymoresecuremethodofencryptionis theVigenere Cipher.

CaesarCipher

Anobviouswaytocrackit?
ItvulnerabletoaBruteForceattack.Thereare only25possibilities.Itdoesnottakelongto runthroughallthesetoseewhichone generatessensibleplaintext. Canyouthinkofamethodwhichisevenmore efficientthan25possibilities?

Giveyouahint:Englishletter frequencies
Any clue?

Source:Wikipediaarticleletterfrequency

CaesarCipherweaknesses
VulnerabletoFrequencyAnalysisattack. Eachletterisalwaystransformedtosame character. FrequencyofeachletterinEnglishisknown. Henceitispossibletomatchthemost frequentlettersinEnglishwiththemost frequentlettersintheciphertext.

VigenereCipher
VigenereCipherisessentiallyarepeatedCaesar Cipher. TheVigenereCipherrequiresakey.Thekeyisa wordsuchasuniversity.Thistranslatesto successiveCaesarCiphershiftsof 20,13,8,21,4,17,18,8,19,24astheletters u,n,i,v,e,r,s,i,tandyarethe 20th,13th,8th...etc.lettersofthealphabet. AVigenereSquare(shownonthenextslide)helps intheencryptionanddecryptionprocess.

VigenereSquareand Demonstration

Shift is not uniform now!

VigenereCipherSecurity
MoresecurethanCaesarCipher. Ifthekeyisameaningfulwordorphrase,thenthe strengthisdiminishedasthekeyiseasiertoguess. Techniquesexisttoestimatethelengthofthekey (Kasiski Examination) Ifthekeyismadethesamelengthasthemessage itself,thenthesystembecomesaonetimepad i.e. akeythatisrandom,aslongastheplaintext,isused onlyonceandisknownonlytothesenderand receiver.

LectureOutline
EncryptionBasics SimpleEncryption CaesarandVigenere Ciphers ComputersandEncryption EncryptionTechniques Cryptoanalytic Attacks

ComputersandEncryption
Theavailabilityofcomputersandinternethas changedencryptionandencodingnumberofways.: Encryptionanddecryptionbycomputersismuch faster.Encryptionschemesneedmuchmorerobust. Traditionalencryptionmethods(Caesarand Vigenere)workatthelevelofcharacters.Computer encryptionworksatthebitlevel. Manyoftheapplicationsusedontheinternetsuch asecommerceandVPNsrequirerobust,open and secureencryption.

WhatmakesaneffectiveEncryption?
Encryptiontransformstheplaintextinto ciphertext. Itshouldbevery,very,veryhard(ifnot impossible)toascertaintheplaintextfromthe ciphertext,evenwhentheencryptionmethod isknown,butthekeyisnot. Formoderncomputerbasedencryptionthe encryptionalgorithmisknownbyall itisthe keyorkeyswhicharekeptsecret.

SubstitutionandTransposition Ciphers
CaesarandVigenere Ciphersareexamplesof SubstitutionCiphers onecharacterintheplaintext isreplacedbyanothercharacterintheciphertext. TranspositionCipher anothersimplecipherin whichtheplaintextisrearranged(positions transposed). Cipherswhichonlyperformsubstitutionoronly performtranspositionareinherentlyweak. Acipherwhichperformsmorethanoneoperationon theplaintextwilltendtobestronger.Thistypeof cipherisaProductCipher.

ModernDigitalCiphers
ModernDigitalCipherscanoperateonone characteratatimeoronblocksofcharacters. Ciphersoperatingononecharacteratatime areStreamCiphers.Ciphersoperatingon blocksofcharactersareBlockCiphers. ModernBlockCiphersareallProductCiphers

ProductCiphers
Operationswhichmaybeperformedbyproduct ciphersoperatingonbitsratherthancharacters include: Substitution Transposition Swap BitInversion CircularShift XORoperation

* Otheroperationsarealsopossiblebuttheonesabovearethemostcommon

SBox
StandsforSubstitutionBox. Usedinmanysymmetricencryptionalgorithms. SBoxisspecifiedasanmxntable. Involvessubstitutingblocksofmbitswithblocks ofnbits(notenisoften<m) AnSBoxwherethem=n(i.e.thenumberof inputbitsisthesameasthenumberofoutput bits)isreversible.

3x3SBoxExample
Right2Bits Le 1Bit

00 011 000

01 101 010

10 111 001

11 100 110

0 1

ThisisaverysimpleexampleofanSBox.RealSBoxes arelarger.AnnxnSBoxisinvertible(i.e.knowingthe outputs,youcandeducetheinputs) Thisexampletakes3inputbitsandoutputs3different bits

3x3SBoxExample(2)
Right2Bits Le 1Bit

00 100 011

01 110 001

10 101 111

11 000 010

0 1

TheSBoxabovedecryptstheoutputoftheS Boxonthepreviouspage. Lets write them down

PBoxes
ThisisaPermutationBox Involvesthetranspositionofbinarydigits withinblocks. Mayalsoinvolveexpansionorcompressionof theinputbits. Usedtobringaboutdiffusion.

ExamplePBox
Example 10110

ExpansionPBox

Swap

BitInversion(akacomplement)
Inbitinversionevery0ischangedtoa1andevery1 ischangedtoa0.

CircularShift
Inashiftoperation,bitsarerotatedeithertotheleftor right.Nobitsarelost,buttheirpositionischanged.

XOROperation
Booleanfunctionthatworksonbinaryvalues i.e.1and0 StandsforExclusiveOR Extensivelyusedincryptographicalgorithms. XORencipherment doesnotgiveanyreal securitybutisusefulwhencombinedwith otheroperations.

XOROperation
Booleanfunctionthatworksonbinaryvalues i.e.1and0 StandsforExclusiveOR Extensivelyusedincryptographicalgorithms. XORenciphermentdoesnotgiveanyreal securitybutisusefulwhencombinedwith otheroperations.

XORTruthTable
Input 1 0 1 0 1 Input 2 0 0 1 1 Output 0 1 1 0

Producesanoutputof1whenone,andonlyone oftheinputsis1 hencethenameexclusiveor

ExampleXOR Encipherment/Decipherment

ConfusionandDiffusion
ConfusionandDiffusion aredesirablefeatures ofencryptionalgorithmsbecausetheymake cryptananlysisdifficult.Thatis,theymakeit moredifficulttobreakencryptedcode. Allmodernencryptionalgorithmsproduce confusionanddiffusion.

ConfusionandDiffusion

ConfusionandDiffusion simple explanations


Confusionlooksattherelationshipbetweenthekey andtheciphertext.Changethekeyevenslightlyand theencryptedmessage(theciphertext)changes completely.Thisfrustratesattemptstofindthekey usingdifferentsamplesofciphertext. Diffusionlooksattherelationshipbetweenmessage (theplaintext)andtheencryptedmessage(the ciphertext). Changetheoriginalmessageeven slightlyandtheencryptedmessagechangesalot. Thisfrustratesattemptstofindtheplaintextusing statisticsdrawnfromtheciphertext.

TypesofProductCiphers
Feistel ProductCiphers:Bothinvertibleand noninvertibleoperationsareperformedon theplaintext. oneexampleistheDES encryptionstandard. NonFeistel ProductCipher:onlyinvertible operationsareperformedontheplaintext. OneexampleofthisistheAESencryption standard.

Feistel

TaxonomyoftheEncryption Algorithms
Classifiedalongthreeindependentdimensions:
Operationsusedi.e.thetypeandarrangementof substitutionsandtranspositions Keysused
symmetric(singlekey) asymmetric(twokeys,orpublickeyencryption)

Thewaywhichtheplaintextisprocessed
Blockcipher plaintextprocessedinblocks Streamcipher plaintextprocessedonecharacteratatime

CryptoanalyticAttacks
Classifiedalong2dimensions: Resourcespossessedbyattacker Methodofattackadopted

Resourcespossessedbythe attacker

AttackTypes

AttackTypes
Encryptionschemevulnerabletoeitherciphertext onlyorplaintextonlyattackisextremelyweak. CaesarandVigenere Ciphersarebothvulnerableto ciphertext onlyandplaintextattacks. Chosenplaintextattackcanbedifficulttoresistasa knowledgeablecryptanalystcanchooseaplaintext thatwillrevealthekey. Chosenciphertext andtextattacksarelesscommon.

AttackMethods
BruteForce:Thismethodgoesthroughallthe availablekeys,testingeachoneuntilthe correctkeyisfound. Exploitaweaknessintheencryption algorithm.

BruteForceAttack
BruteForceattackwillalwaysfindthekey eventually. Maindefenceistomakethenumberof possiblekeysalargenumber atleast2128. Thismakesthesearchforthekeytime prohibitive. Theeffectivenessofbruteforceattackscan beenhancedbyaddingmorehardware. Purposedesignedhardwarecanbeevenmore effective.

Attacksbasedonaweakness
Allofthecommonlyusedprotocolshavebeen extensivelyanalysed. Encryptionstandardswithknownweaknesses aredroppedfairlyquickly. Networkingprotocolsthatexchange encrypteddataallowattackerstocollect encrypteddataandfromtherepossibly mountanattack.

LectureSummary
EncryptionBasics
Terms Crytpology,Cryptanalysis,Cryptography

SimpleEncryption CaesarandVigenere Ciphers


CaesarCipher howitworks VigenereCipher howitworks

LectureSummary
ComputersandEncryption
EffectsofComputersonencryption EncryptionandSecurityGoals

EncryptionTechniques
Substitution,TranspositionandProductCiphers Encryptionprocesses substitution,transposition, swap,invert,circularshift,XOR Unary/binary,reversible/nonreversible operations ConfusionandDiffusion

LectureSummary
CryptoanalyticAttacks
AttackResources plaintext,chosenplaintext, chosenciphertext,text. AttackTypes BruteForce,exploitweakness

You might also like