anthony zanontian - ucsd presentation on cryptography

24
04/03/29 1 Cryptography Cryptography Kevin O’Bryant [email protected] www.math.ucsd.edu/~kobryant Math 187 MWF 4:00 – 4:50 pm www.math.ucsd.edu/~crypto

Upload: anthony-zanontian

Post on 18-Nov-2014

913 views

Category:

Education


5 download

DESCRIPTION

Anthony Zanontian - class taken on cryptography this is one of the professors slides i found from a few years back

TRANSCRIPT

Page 1: Anthony Zanontian - UCSD presentation on Cryptography

04/03/29 1

CryptographyCryptography

Kevin O’[email protected]/~kobryant

Math 187MWF 4:00 – 4:50 pmwww.math.ucsd.edu/~crypto

Page 2: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 22

DefinitionsDefinitions

PlaintextPlaintext• The message that Alice wants Bob to readThe message that Alice wants Bob to read

CiphertextCiphertext• The message that Alice sends BobThe message that Alice sends Bob

CryptosystemCryptosystem• The algorithm that Alice uses to turn plaintext The algorithm that Alice uses to turn plaintext

into ciphertext.into ciphertext. KeyKey

• Something Bob and Alice agree on beforehand Something Bob and Alice agree on beforehand that customizes the cryptosystemthat customizes the cryptosystem

Page 3: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 33

CryptosystemsCryptosystems Two basic types:Two basic types:

• Substitution (replace letters)Substitution (replace letters)• Transposition (rearrange letters)Transposition (rearrange letters)

Caeser CipherCaeser Cipher• Shift each letter by the same amountShift each letter by the same amount• Key: how much to shiftKey: how much to shift

Monoalphabetic SubstitutionMonoalphabetic Substitution• Replace each letter with some other letter in a one-to-Replace each letter with some other letter in a one-to-

one mannerone manner• Key: the bottom line ofKey: the bottom line of

Plaintext: abcdefghijklmnopqrstuvwxyzPlaintext: abcdefghijklmnopqrstuvwxyzCiphertext: QWERTYUIOPASDFGHJKLZXCVBNMCiphertext: QWERTYUIOPASDFGHJKLZXCVBNM

Page 4: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 44

Caeser CipherCaeser Cipher

GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ WZVM JPMNZGQZN, OCVO DA OCZ YPOT, VIY NJ WZVM JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, 'OCDN RVN OCZDM ADIZNO CJPM.‘'OCDN RVN OCZDM ADIZNO CJPM.‘

Caeser CipherCaeser Cipher• StrengthsStrengths

Very FastVery Fast Easy to rememberEasy to remember

Page 5: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 55

Cipher WheelsCipher Wheels

Page 6: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 66

Caeser CipherCaeser Cipher

GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ WZVM GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ WZVM JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, 'OCDN RVN OCZDM AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, 'OCDN RVN OCZDM ADIZNO CJPM.‘ADIZNO CJPM.‘

Caeser CipherCaeser Cipher• StrengthsStrengths

Very FastVery Fast Easy to rememberEasy to remember

• WeaknessesWeaknesses Formatting gives away the houseFormatting gives away the house Small number of keys: 26 (and one is weak)Small number of keys: 26 (and one is weak) Frequency analysisFrequency analysis

Page 7: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 77

Strengthening CaeserStrengthening Caeser

Fixing the Formatting WeaknessFixing the Formatting Weakness• Strip out punctuation, and put letters in Strip out punctuation, and put letters in

blocks of the same length.blocks of the same length.GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ GZO PN OCZMZAJMZ WMVXZ JPMNZGQZN OJ JPM YPOT, VIY NJ WZVM JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON WZVM JPMNZGQZN, OCVO DA OCZ WMDODNC ZHKDMZ VIY DON XJHHJIRZVGOC GVNO AJM V OCJPNVIY TZVMN, HZI RDGG XJHHJIRZVGOC GVNO AJM V OCJPNVIY TZVMN, HZI RDGG NODGG NVT, 'OCDN RVN OCZDM ADIZNO CJPM.‘NODGG NVT, 'OCDN RVN OCZDM ADIZNO CJPM.‘

becomesbecomes

GZOP NOCZ MZAJ MZWM VXZJ PMNZ GQZN OJJP MYPO TVIY GZOP NOCZ MZAJ MZWM VXZJ PMNZ GQZN OJJP MYPO TVIY NJWZ VMJP MNZG QZNO CVOD AOCZ WMDO DNCZ HKDM ZVIY NJWZ VMJP MNZG QZNO CVOD AOCZ WMDO DNCZ HKDM ZVIY DONX JHHJ IRZV GOCG VNOA JMVO CJPN VIYT ZVMN HZIR DONX JHHJ IRZV GOCG VNOA JMVO CJPN VIYT ZVMN HZIR DGGN ODGG NVTO CDNR VNOC ZDMA DIZN OCJP MDGGN ODGG NVTO CDNR VNOC ZDMA DIZN OCJP M

Page 8: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 88

Strengthening CaeserStrengthening Caeser

Key weakness is fixed by monoalphabetic Key weakness is fixed by monoalphabetic substitutionsubstitution• StrengthsStrengths

403,291,461,126,605,635,584,000,000 keys403,291,461,126,605,635,584,000,000 keys FastFast

• WeaknessesWeaknesses How many keys are easy to remember?How many keys are easy to remember? Frequency analysisFrequency analysis

We saw the frequencies of individual letters, but it is also possible---We saw the frequencies of individual letters, but it is also possible---and reasonable---to look at pairs of letters, and triples, etc. More and reasonable---to look at pairs of letters, and triples, etc. More on this in three weeks.on this in three weeks.

Page 9: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 99

Strengthening CaeserStrengthening Caeser

Fixing Frequency analysisFixing Frequency analysis• Many ways to make frequency analysis Many ways to make frequency analysis

harder: harder: send “e” to 3 letters (do you really need z send “e” to 3 letters (do you really need z

and x?)and x?) spell poorly (do you really need all those spell poorly (do you really need all those

silent letters?)silent letters?) send short messagessend short messages use several different keys in one messageuse several different keys in one message

Page 10: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1010

VigenVigenèère’s Cryptosystemre’s Cryptosystem Let’s encrypt the plaintextLet’s encrypt the plaintext

““prince is my favorite musician”prince is my favorite musician”with the keyword “GUITAR”.with the keyword “GUITAR”.

Step 1: strip formatting:Step 1: strip formatting:““prince ismyfa vorite musici an”prince ismyfa vorite musici an”

using blocks the same length as our keyword.using blocks the same length as our keyword. Step 2: encrypt the first letter of each block with the Step 2: encrypt the first letter of each block with the

Caeser-cipher that sends “a” to “G”, the second with that Caeser-cipher that sends “a” to “G”, the second with that C-c that sends “a” to “U”, the third with that C-c that sends C-c that sends “a” to “U”, the third with that C-c that sends “a” to “I”, the fourth by sending “a” to “T”, fifth by sending “a” to “I”, the fourth by sending “a” to “T”, fifth by sending “a” to “A”, the sixth by sending “a” to “R”.“a” to “A”, the sixth by sending “a” to “R”.

VLQGCV OMURFR BIZBTV SOABCZ GHVLQGCV OMURFR BIZBTV SOABCZ GH Step 3: reformat into a (possibly) different block length.Step 3: reformat into a (possibly) different block length.

VLQG CVOM URFR BIZB TVSO ABCZ GHVLQG CVOM URFR BIZB TVSO ABCZ GH

Page 11: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1111

VigenVigenèère’s Cryptosystemre’s Cryptosystem

StrengthsStrengths• Infinite number of keywordsInfinite number of keywords• Scrambles frequenciesScrambles frequencies• Easy to remember keyEasy to remember key• Considered unbreakable in Black chambers for Considered unbreakable in Black chambers for

200 years200 years WeaknessesWeaknesses

• Can perform frequency analysis if we know-or Can perform frequency analysis if we know-or guess-the length of the keywordguess-the length of the keyword

Page 12: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1212

VigenVigenèère’s Cryptosystemre’s Cryptosystem

HistoryHistory• Idea of entertwining two keys came Idea of entertwining two keys came

from Leon Battista Alberti around 1465 from Leon Battista Alberti around 1465 in Florencein Florence

• Developed byDeveloped by Johannes TrithemiusJohannes Trithemius Giovanni PortaGiovanni Porta Blaise de VigenBlaise de Vigenèère re

Page 13: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1313

The Alpha and the Omega of The Alpha and the Omega of VigenVigenère’s cryptosystemère’s cryptosystem

Page 14: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1414

VigenVigenèère’s Cryptosystemre’s Cryptosystem

HistoryHistory• Idea of entertwining two keys came Idea of entertwining two keys came

from Leon Battista Alberti around 1465 from Leon Battista Alberti around 1465 in Florencein Florence

• Developed byDeveloped by Johannes TrithemiusJohannes Trithemius Giovanni PortaGiovanni Porta Blaise de VigenBlaise de Vigenèère re

• Broken by Charles BabbageBroken by Charles Babbage• Publicly broken by Friedrich KasiskiPublicly broken by Friedrich Kasiski

Page 15: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1515

The Vision of SinThe Vision of SinSit thee down, and have no shame,Sit thee down, and have no shame,Cheek by jowl, and knee by knee:Cheek by jowl, and knee by knee:What car I for any name?What car I for any name?What for order or degree?What for order or degree?

Let me screw thee up a peg:Let me screw thee up a peg:Let me loose thy tongue with wine:Let me loose thy tongue with wine:Callest thou that thing a leg?Callest thou that thing a leg?Which is thinnest? Thine or mine?Which is thinnest? Thine or mine?

Thou shalt not be saved by works:Thou shalt not be saved by works:Thou has been a sinner too:Thou has been a sinner too:Ruined trunks on withered forks,Ruined trunks on withered forks,Empty scarecrows, I and you!Empty scarecrows, I and you!

Fill the cup, and fill the can:Fill the cup, and fill the can:Have a rouse before the morn:Have a rouse before the morn:Every moment dies a man,Every moment dies a man,Every moment one is born.Every moment one is born.

Alfred Tennyson

Image taken fromhttp://charon.sfsu.edu/TENNYSON/tennyson.html

Page 16: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1616

Babbage to TennysonBabbage to Tennyson

[suggested correction to “otherwise [suggested correction to “otherwise beautiful” poem]beautiful” poem]

It must be manifest that if this were true, the It must be manifest that if this were true, the population of the world would be at a population of the world would be at a standstill . . . I would suggest that in the standstill . . . I would suggest that in the next edition of your poem you have it read next edition of your poem you have it read – “Every moment dies a man, Every – “Every moment dies a man, Every moment 1 moment 1 11//1616 is born.” The actual figure is is born.” The actual figure is so long I cannot get it onto a line, but I so long I cannot get it onto a line, but I believe the figure 1 believe the figure 1 11//1616 will be sufficiently will be sufficiently accurate for poetry.accurate for poetry.

Page 17: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1717

TranspositionsTranspositionsPart of an actual telegram from Union Army General Halleck to General Buell Part of an actual telegram from Union Army General Halleck to General Buell

(quoted from Battle Cry of Freedom: The Civil War Era)(quoted from Battle Cry of Freedom: The Civil War Era)YOU MARCHED THE IS THE ELSEWHERE MOVE OF SURPRISING TWO TIMES YOU MARCHED THE IS THE ELSEWHERE MOVE OF SURPRISING TWO TIMES HALLECK AS SLOWLY ARMY IN HAS DISTANCE HAVE FOUR LAST MOST HALLECK AS SLOWLY ARMY IN HAS DISTANCE HAVE FOUR LAST MOST IMMOBILITY YOU HERE TOO YOUR BRAGG MONTHS THEIMMOBILITY YOU HERE TOO YOUR BRAGG MONTHS THE

HEREHERE ASAS ELSEWHEREELSEWHERE YOUYOU MOVEMOVE

TOOTOO SLOWLYSLOWLY THETHE IMMOBILITYIMMOBILITY OFOF

YOURYOUR ARMYARMY ISIS MOSTMOST SURPRISINGSURPRISING

BRAGGBRAGG ININ THETHE LASTLAST TWOTWO

MONTHSMONTHS HASHAS MARCHEDMARCHED FOURFOUR TIMESTIMES

THETHE DISTANCEDISTANCE YOUYOU HAVEHAVE HALLECKHALLECK

Page 18: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1818

From LincolnFrom Lincoln1863 WOULD RELIEVED 1863 WOULD RELIEVED MEADE SINCE HAVE THE MEADE SINCE HAVE THE WITHOUT ME WAS WHO THE WITHOUT ME WAS WHO THE SATURDAY HEVY A WAR SATURDAY HEVY A WAR FIGHTING CORPS KNOW FIGHTING CORPS KNOW PLEASE THE TO OF AND PLEASE THE TO OF AND IMPRESSION TO CAMERON 15 IMPRESSION TO CAMERON 15 I BE THAT ALL GETTYSBURG I BE THAT ALL GETTYSBURG GET RIVER TELL WHO GET RIVER TELL WHO COMMANDER IN ON LINCOLN COMMANDER IN ON LINCOLN SIGNED OF FOR ONE YOU SIGNED OF FOR ONE YOU FIGHT OVER ONLY BATTLE FIGHT OVER ONLY BATTLE SMITH THE MUCH SIMON SMITH THE MUCH SIMON WASHINGTON FOR GIVE OF WASHINGTON FOR GIVE OF COUCH THE STRIVEN ENEMY COUCH THE STRIVEN ENEMY ANOTHER IF THE WAS ANOTHER IF THE WAS COUNCIL NIGHTCOUNCIL NIGHT

Image fromhttp://www.picturehistory.com/

Page 19: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 1919

Rectangular TranspositionRectangular Transposition

Let’s encryptLet’s encrypt““Out of life’s school of war: What does Out of life’s school of war: What does not destroy me, makes me stronger.”not destroy me, makes me stronger.”with keyword Nietzschewith keyword Nietzsche

The lexicographically first letter in The lexicographically first letter in our keyword is c, followed by e, e, h, our keyword is c, followed by e, e, h, i, n, s, t, z:i, n, s, t, z:

6 5 2 8 9 7 1 4 36 5 2 8 9 7 1 4 3

Page 20: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 2020

Rectangular TranspositionRectangular Transposition

Step 2: Write the plaintext under the Step 2: Write the plaintext under the permutation rowwisepermutation rowwise

66 55 22 88 99 77 11 44 33

oo uu tt oo ff ll ii ff ee

ss ss cc hh oo oo ll oo ff

ww aa rr ww hh aa tt dd oo

ee ss nn oo tt dd ee ss tt

rr oo yy mm ee mm aa kk ee

ss mm ee ss tt rr oo nn gg

ee rr qq jj xx zz uu vv rr

Page 21: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 2121

Rectangular TranspositionRectangular Transposition66 55 22 88 99 77 11 44 33

oo uu tt oo ff ll ii ff ee

ss ss cc hh oo oo ll oo ff

ww aa rr ww hh aa tt dd oo

ee ss nn oo tt dd ee ss tt

rr oo yy mm ee mm aa kk ee

ss mm ee ss tt rr oo nn gg

ee rr qq jj xx zz uu vv rr

•Step 3: Write down the columns according to the numbers at the top:ILTEAOU TCRNYEQ EFOTEGR FODSKNV USASOMR

OSWERSE LOADMRZ OHWOMSJ FOHTETX

Page 22: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 2222

Rectangular TranspositionRectangular Transposition

Step 4: Break into grams of a Step 4: Break into grams of a different length:different length:

ILTEAOU TCRNYEQ EFOTEGR FODSKNV USASOMR

OSWERSE LOADMRZ OHWOMSJ FOHTETX

becomesILTEA OUTCR NYEQE FOTEG RFODS KNVUS

ASOMR OSWER SELOA DMRZO HWOMS JFOHT ETX

Page 23: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 2323

GradesGrades

6 out of 7 quizzes (60%)6 out of 7 quizzes (60%) Computer Homework (20%)Computer Homework (20%) Final Exam (or project) (20%)Final Exam (or project) (20%)

Page 24: Anthony Zanontian - UCSD presentation on Cryptography

04/03/2904/03/29 2424

SummarySummary

Caeser SucksCaeser Sucks Monoalphabetic substitution is betterMonoalphabetic substitution is better Vigenère is goodVigenère is good Transposition is a nice idea, and Transposition is a nice idea, and

deserves to be looked at moredeserves to be looked at more The EndThe End