MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the...
Transcript of MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the...
![Page 1: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/1.jpg)
MISM 1
![Page 2: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/2.jpg)
• Understandbasiccryptographyandsecurityterms• Understandsecurityintermsof:– Securewebtransmission– Authentication• Whoareyou?
– Authorization• Whatareyouallowedtodo?
– Certificates,andDigitalSignatures• Isthisdocument/software/transactionreal?
• Haveabasicunderstandingoftheunderlyingtheoryandmathbehindwebsecurity.
MISM 2
![Page 3: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/3.jpg)
• Symmetrickey– Historicandverysimple:Caesarcipher–Mostprevalent:AES
• Asymmetrickey– AlsoknownasPublicKey(orPrivate/PublicKey)–Mostprevalent:RSA
MISM 3
![Page 4: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/4.jpg)
• Pickakey(anumber)• Shiftthelettersoftheplaintextbythekeytocreatetheciphertext.
• E.g.– Plaintext:Yellowcake– Key:3– Ciphertext:Bhoorz fdnh
MISM 4
Source:http://en.wikipedia.org/wiki/File:Caesar3.svg
![Page 5: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/5.jpg)
• Secretkeyalgorithm– Thesenderandthereceivershareasecretkey
• Symmetricalgorithm– Trivially-relatedkeysareusedtoencodeanddecodethemessage• Trivially-related:usesthesamekey,orkeysrequireonlyasimpletransformation.– Caesarcipher:(inEnglish)the2nd keyis26minustheoriginalkey
MISM 5
![Page 6: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/6.jpg)
• Onewaytodiscovertheplaintextistoexhaustivelytryeverypossiblekey.
• IstheCaesarciphersusceptibletobruteforceattack?
MISM 6
![Page 7: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/7.jpg)
• Useextremelylargekeys– An8bitkeyhas28 possiblekeys• 256
– A16bitkeyhas216 possiblekeys• 65,536
– A32bitkeyhas232 possiblekeys• 4,294,967,296
– A256bitkeyhas2256 possiblekeys• 1.15792089× 1077
MISM 7
![Page 8: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/8.jpg)
• Cryptographyisessentiallytrying– to"messup"theoriginaldataasmuchaspossible– sothatsomeoneelsecannotfindtheoriginal– butbeabletogettheoriginaldatabackwithakey
• Encryption="messup"
• Sohowcanwe"messup"thedatabetterthantheCaesarcipherdoes?– Theblocksofplaintextareonecharacter.– Thereisonlysomuchyoucandotoonecharacter.– Sohowaboutencryptingblocksofdata?
MISM 8
![Page 9: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/9.jpg)
• Symmetrickeycipher• Worksonblocksoftext– E.g.128bitblocks
• SimpleCaesarexample– Dosimpleencodingofcake(c=3,a=1,k=11,e=5)
• Encodingistransformingtoadifferentrepresentation– Itisnotencryption.
• Howmanybitsdoyouneedfor26letters?• 5because25 =32
– Letsusea2-characterblock(so10bits)• Howmanybitscanthekeybe?
– LetsuseaKeyof1(forsimplicity)– Plaintext: 00011000010101100101– Ciphertext: 00011000100101100110
MISM 9
10
![Page 10: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/10.jpg)
• Ifblocks'plaintextareidentical,thentheirciphertext willalsobeidentical.
• Thiscanbeseenvisuallyinthefollowing3pictures.• Whatyouwantitthe3rd picture.• Onewaytodosoistomessupthecurrentblockwithinfofromits
priorblock.
MISM 10Imagesource:http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation
Original BlockCipher BlockCipherChaining
![Page 11: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/11.jpg)
• EachblockisXOR’ed withthepreviousblockbeforeencrypting– ThefirstblockisXOR'ed withaninitializationvector– Theinitializationistypicallyarandomnumber
• Thereforeeachblockisdependentonallplaintextblocksuptothatpoint01001 - initializationvector00001 - key5bitblock(e.g.onecharacter)cake00011000010101100101 - encodedplaintext01010 - xor c01011 - encryptc
01010 - xor a01011 - encrypta
00000 - xor k00001 - encryptk
00100 - xor e00101 - encrypte
01011010110000100101 - encryptedciphertext
MISM 11
XOR0 ^ 0 = 00 ^ 1 = 11 ^ 0 = 11 ^ 1 = 0
![Page 12: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/12.jpg)
• Verycomplexchainingblockcipher• Symmetricalgorithm• AdoptedbyUSNationalInstituteofStandards– Replacedtheformerstandard:DES• DataEncryptionStandard– 56bitkeyblockcipher
• Checkwhatyourbrowseruses:– InChrome,browsetosomehttps://…site– Clickonpadlock,andchoose"Connection"tab
MISM 12
![Page 13: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/13.jpg)
• SymmetricalgorithmsrequireAliceandBobtoshareasecret(thekey).– Bothcanencryptanddecryptmessages
• Asymmetricalgorithmsallowfornotsharingasecret.– AlicecanencodeamessageforBob– ShecannotdecodemessagesalreadyencodedforBob
MISM 13
![Page 14: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/14.jpg)
MISM 14
Secret Key
Secret Key
![Page 15: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/15.jpg)
MISM 15
Public Key Private Key
Private Key Public Key
![Page 16: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/16.jpg)
MISM 16
Public Key Public Key
Private Key Private Key
![Page 17: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/17.jpg)
• Usesasymmetrickeys• Singlepublickey– Lettheworldsee
• Singleprivatekey– Youkeepsecret
MISM 17
![Page 18: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/18.jpg)
• RSAisacommonpublickeyencryptionalgorithm– Namedforitsauthors:Rivest,Shamir,&Adleman
• Developed in1977• Basedonthemathematicsoflargeprimenumbers– Ifyouhavethenumbers,youcanusethemtoencryptmessages
– Ifyoudon'thavethenumbers,itisinfeasibletoguessthem
MISM 18
![Page 19: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/19.jpg)
• Codewalk-through(RSAExample.java)• Questions–Whatarethecomponentsofthepublickey?–Whatarethecomponentsoftheprivatekey?–Whatlinedoestheencryption?–Whatlinedoesthedecryption?–Whywouldn'tusingthesamekeytwicereturntheoriginalplaintext?
MISM 19
![Page 20: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/20.jpg)
• y =x5%851• Seeapattern?• Canyoupredictthevalueat101?
• Unpredictabilityisitsstrength
• Reddotisat(53,477)
• Correspondingkeyis{d:317,n:851}
• 477317%851=53MISM 20
0
100
200
300
400
500
600
700
800
900
0 10 20 30 40 50 60 70 80 90 100
![Page 21: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/21.jpg)
1. Encryption/Decryption– Publickey
• Usedbyothers• Toencryptamessageintendedonlyforyou
– Privatekey• Usedbyyou• Todecryptamessageoriginallyencryptedbyyourpublickey
2. Signing/Verification– Privatekey
• Usedtosignadocumentsothatotherscanverifythesource– Publickey
• Usedtoverifythatasigneddocumentwassignedbyyou.MISM 21
![Page 22: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/22.jpg)
1. Encryption/Decryption– Publickey
• Usedbyothers• Toencryptamessageintendedonlyforyou
– Privatekey• Usedbyyou• Todecryptamessageoriginallyencryptedbyyourpublickey
2. Signing/Verification– Privatekey
• Usedtosignadocumentsothatotherscanverifythesource– Publickey
• Usedtoverifythatasigneddocumentwassignedbyyou.MISM 22
![Page 23: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/23.jpg)
• How canyouguaranteetosomeonethatadocumentyousentthemisfromyou,andhasnotbeenchanged?
• HowcanyouguaranteethatthesoftwareyouareusingcamefromMicrosoft,andthatithasnotbeenaltered?
• Youwanttokeepthedocument/software/image/etc.viewableandusable,butjustwantaschemebywhichotherscanverifyitsauthenticity.
MISM 23
![Page 24: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/24.jpg)
• Publickeyencryptioncanbeusedtoprovidedigitalsignaturestovalidateauthenticity
• Digitalsignaturesarebetterthatrealsignatures,forpeoplecanalterapaperdocumentonceyouhavesignedit.
• Withdigitalsignatures,ifthedocumentischanged,thenthesignaturebecomesinvalid.
• Thisisbecausethesignatureisanumberbasedonthecontentofthedocument.– Ormorespecifically,onthehashvalue ofadocument.
MISM 24
![Page 25: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/25.jpg)
• RememberyoucalculatedhashvaluesinProject1!• Takesafile(application,document,picture,etc.)• Returnsalarge,butfixed-sizenumber.• Anyintentionaloraccidentalchangeinthefilewillchangeitsresultinghashvalue.
• Thefilebeingencodediscalledthe“message”• Theresultinghashvalueisalsocalledthe– "MessageDigest"– Orsimply"Digest"
MISM 25
![Page 26: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/26.jpg)
1. Foranymessage,thehashvalueiseasytocompute.2. Itisinfeasibletocreateanewmessagethathasagiven
hashvalue– I.e.thoughyouknowthehashvalue,youcan'tcreateadocumenttomatchthathashvalue
3. Itisinfeasibletomodifyamessageinanywaywithoutchangingitshashvalue– Allmodificationschangethehashvalue.
4. Itiscompletelyunlikelythattwodocumentswillhavethesamehashvalue– Soyoudon’thavetoworrythatMallorywilljustbeluckyandfindanotherdocumentwiththesamehashvalue
MISM 26
![Page 27: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/27.jpg)
• SHA– DesignedbytheNationalSecurityAdministration(NSA)– SHA-1
• 160bitdigest– InFeb2017,adeliberatecollisionwasdemonstrated*
• Breakingproperty#2onthepreviousslide– SHA-2
• Afamilyofrelatedhashfunctions• SHA-256(weusedforProject1)hasa256bitdigest
• MD5– 128bitdigest
• BothSHA-256andMD5areoftenrepresentedasstringsofhexdigits– (AsyoudidinProject1)
MISM 27
*GoogleannouncedthattheyhaddemonstratedaSHA-1collisionon2/23/17:https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html
![Page 28: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/28.jpg)
• Canahashfunctionbeusedtoencryptamessage?
MISM 28
![Page 29: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/29.jpg)
• Takeyourdocument(emailmessage,etc)• Calculateahashfunctiononit.– e.g.SHA-256
• Encrypttheresultinghashvaluewithyourprivatekey.
• Theencryptedhashvalueisthedigitalsignature.• Sendit…
MISM 29
![Page 30: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/30.jpg)
• …Therecipient• Receivesthedocument(emailmessage,etc)andthedigitalsignature.
• Decryptsthesignaturewith_____________resultingin_________________
• Calculateahashofthedocument&compareitwiththesender’shashvalue
• Shouldtheybeequal?Why?
MISM 30
![Page 31: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/31.jpg)
• Whatdoesitmeanifthehashvaluesarenotequal?
• CouldMallorychangethedocument?• CanMallorychangethedocumentwithoutchangingthehashvalue?
• CanEvereadthedocument(email,etc.)?–Whatcanyoudoaboutthat?
MISM 31
![Page 32: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/32.jpg)
• Howcanwesecurelytransferpublickeys?• ADigitalCertificateisadocumentthatprovidesinformationaboutanorganization–Mostimportantly,itspublickey
• AndtheDigitalCertificateisdigitallysignedbysometrustedparty.
MISM 32
![Page 33: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/33.jpg)
• Issuedbytrustedentities– CompanyITDepartment(internally)– VeriSign– Thawte– Lotsofothers
• Typicallycontains– Owner’sname– Owner’spublickey– Expirationdate– Nameofcertificateissuer– Serialnumber– Issuer’sdigitalsignature
• E.g.BlackboardDigitalCertificate
MISM 33
![Page 34: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/34.jpg)
MISM 34
![Page 35: MISM 1 - €¢Pick a key (a number) •Shift the letters of the plaintext by the key to create the ciphertext. •E.g. –Plaintext: Yellow cake –Key: 3 –Ciphertext: Bhoorzfdnh](https://reader034.fdocuments.in/reader034/viewer/2022051601/5ae1a8ea7f8b9a90138b61b0/html5/thumbnails/35.jpg)
MISM 35
ByYanpas - Ownwork,CCBY-SA4.0,https://commons.wikimedia.org/w/index.php?curid=46369922