Top Banner
Ciphers: Making and Breaking Ralph Morelli Trinity College, Hartford ([email protected]) Smithsonian Institute October 31, 2009
40

October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford ([email protected]) Smithsonian Institute October

Sep 15, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Ciphers: M

aking and Breaking

Ralph M

orelli

Trinity C

ollege, Hartford

(ralph.morelli@

trincoll.edu)

Smithsonian Institute

October 31, 2009

Page 2: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

This presentation w

as created using Open O

ffice 3.0, free and open source softw

are. http://w

ww

.openoffice.org/

© 2009 R

alph Morelli

You are free to reuse and rem

ix this presentation under a creative comm

ons license provided you give credit to the author. http://creativecom

mons.org/licenses/by/3.0/us/

Page 3: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Today's Them

es

•C

rypto Cat vs. M

ouse: Cryptographer vs.

Cryptanalyst

•T

heoretical security vs. practical security

•Im

plementation, im

plementation, im

plementation

•T

he key is security.

Page 4: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Part I: Classical C

ryptology

Page 5: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Basic Term

inology

Page 6: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Secret W

riting

C

ryptography – making secret m

essages.

C

ryptanalysis – breaking secret messages.

C

ryptology – cryptography and cryptanalysis.

S

teganography – concealing messages.

Page 7: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Cipher

C

ipher – a method for transform

ing a message.

Cipher

meet m

e at sixm

mseeieaxtt

encipher

decipher

plaintextplaintext

ciphertext

Page 8: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Code

C

ode – a system in w

hich codewords replace

plaintext words or sym

bols using a codebook.

Codebook

...at 15……m

e 146 m

eet 149 …six 652

meet

me at

six

149 146 15 652

Page 9: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Types of Cipher

Transposition

Cipher

(rearrange)hello

ELO

LH

23541

SubstitutionC

ipher(replace)

helloK

HO

OR

Pla

inte

xt a

lpha

bet

: a b

c d e f g h i j k l m n o p q r s t u v w x y zCip

her

alph

abet

:

D E

F G H I J K L M N O P Q R S T U V W X Y Z A B C

Page 10: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Earliest C

iphers

Page 11: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Herodotus (484-425 B

.C.)

P

ersian War (~

480 BC

), Dem

aratus' secret m

essage to the Spartans w

as hidden under the w

ax on a wooden tablet (steganography).

Page 12: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

The S

cytale

A

ccording to Plutarch (120 A

D), the S

cytale was a

Greek transposition cipher.

S

ome scholars dispute this.

Page 13: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Lysistrata

A

ristophanes (446 – 386 BC

).

Com

ic anti war (P

eloponnesian) play.

Page 14: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

The H

erald and the Scytale

M

AG

IST

RA

TE

: Then w

hy do you turn aside and hold your cloak so far out from

your body? Is your groin sw

ollen with stress of travelling?

H

ER

ALD

: It's my despatch cane.

M

AG

IST

RA

TE

: Of course--a S

partan cane!

Page 15: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Skytale E

ncryption/Decryption

1)A

ttach paper strip to one end of the dowel.

2) W

ind it tightly and fasten the other end.

3)W

rite each line of the message along dow

el length.

4)R

emove and transm

it the message.

5)To decrypt, repeat steps 1-4 on the sam

e sized dow

el.

Page 16: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Skytale C

ryptanalysis

•W

hat is the key for this cipher?

•B

rute force attack: try all possible keys.

•H

ow m

any possible keys?

–T

he more keys the m

ore secure.

•A

cipher or a comm

unication device?

Page 17: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

The C

aesar Cipher

Julius C

aesar (~ 50 B

.C., G

allic Wars, chapter 48)

reported using secret writing to com

municate w

ith C

icero.

Suetonius reported that C

aesar used an alphabet w

ith a shift of 3.

a b c d e f g h i j k l m

D E F G H I J K L M N O P

n o p q r s t u v w x y z

Q R S T U V W X Y Z A B C

Page 18: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

RO

T13

Q: How can

you tell an extrovert from an introvert at NSA?

A: Va gur

ryringbef, gur rkgebireg ybbxf ng gur BGURE thl'f fubrf.

A B C D

E F G H I J K L M

N O P Q

R S T U V W X Y Z

In t

he elevators, the extrovert looks at the OTHER guy's shoes.

Page 19: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Som

e Sim

ple Transposition C

iphers

Page 20: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Rail F

ence Cipher

Plain: thisisatestofrailfence

t

i

e f l c h

s s

t s o r i f

n e i

a t a e

Crypto: TIEFLCHSSTSORIFNEIATAE

t

a

f e

h

s

t o r f n

i i

e t a l c

s

s i

e

Crypto: TAFEHSTORFNIIETALCSSIE

Depth

4

Depth

3

Page 21: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Route C

ipher

Plain: thisatestoftheroutecipher

t h i s

a t e s

t o f t

h e r o

u te c

i p h e

r z y x

w v

Reverse

horizontal: TASIHT TFOTSE TUOREH EHPICE VWXYR

Down ve

rtical : TEHER HSECZ ITRIY SOOPX AFUHW TTTEV

Diagona

l: T AT SFT I

OUE HTOHV TSRPW EEIX HCY EZ R

Spiral

counterclockwise: VETTT ASIHT EHER ZYXW HUF OTS ECIPOR

Page 22: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Colum

nar Transposition

Plain: thisisatestofcolumntransposition

Ciphertext: ITUNTX IEORSZ HTCTON SSLAIY SOMSIW TAFNPO

T H

I S I SA T

E S T OF C

O L U M N T

R A N S P O

S I T I O N

Z Y X W

6 3

2 4 1 5

Keyword = ZEBRAS = 632415

Page 23: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Cryptanalysis

B

rute force attack – test every possible key.

F

actoring – break the message into rectangles.

F

requency analysis – count letters, vowels.

P

robable word attack – look for probable w

ords.

D

igram, trigram

analysis – look for frequent 2- and 3-letter sequences.

Page 24: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Abū

Yūsuf Y

a‘qūb ibn Isḥā

q al-Kindī

801-873 C

E

“The A

rab Philosopher”

A

rab Iraqi polymath.

A

Manuscript on

Deciphering C

ryptographic M

essages (Ottom

an A

rchives, Instanbul)

First explanation of

frequency analysis.

Dark A

ges in the West

Page 25: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Attacking T

ranspositions

F

actor – to identify possible rectangles.

64 letters could be 8 x 8 or 16 x 4 or four 4 x 4.

Arrange – into rectangle.

C

ount the vowels – 40%

vowels, 12%

e's

Row

s and columns should have ~

40% vow

els.

Rearrange – row

s and/or columns.

D

igrams, trigram

s, probable sequences guide the rearrangem

ents.

Page 26: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Colum

nar Transposition C

aseMessage: ETTUH OMEAW EXETE STDEH TIGYT HLKHS MAODT O

E M

E E

T

M

3T E

T H

H

A

2T A

E T

L

O

3U W

S I

K

D

2H E

T G

H

T

1O X

D Y

S

O

2

3 3

2 2

0

3 Letters = 36 Possible squares 6x6, 9x4, 12x3

E W E K 2T E H H 1T X T S 0U E I M 3H T G A 1O E Y O 4M S T D 0E T H D 1A D L O 2

5 3 3 3

A

nalysis:

In the 6x6 square, the 40% rule gives 2-3 vow

els per row or

column.

T

he rows seem

better, so rearrange the columns.

Page 27: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Let's Solve It !

IELTB O

STAA RIU

ZN IDFEM XKSMO F

PYIH WRMVT TEOKA E

EHRR EYCR

•H

int 1: Count the letters

– 49

•H

int 2: Factor into a rectangle

–7 x 7

•H

int 3: Place 7 letters, L to R

, on 7 strips.

•H

int 4: Rearrange the colum

ns.

–X

, Y, Z ??

I think

there

is a w

orld market for maybe five computers.

– Thomas J. Watson, IBM, 1943

Page 28: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Hands O

n Exam

ple

E M

E E

T M

T E

T H

H A

T A E

T L

OU W

S I

K D

H E

T G

H T

O X

D Y

S O

A

nalysis

A

E (row

3) don't go, swap cols 1 &

3.

ME

ET

ME

in row 1 by m

oving col 1 to end

HH

(row 2) don't go, sw

ap cols 3 & 6

T

HA

becomes T

HE

(row 2) by sw

apping cols 1 and 5.

E M E

E T

MT E

T H H

A

E A

T T L

O

S W

U I K

D

T E

H G H

T

D X

O Y S

O

M E E T M EE T

H H A TA T T L O EW U I K D SE H G H T TX O Y S O D

M E E T M EE T

T H A HA T E L O TW U S K D IE H T H T GX O D S O Y

M E E T M EA T T H E HO T E L A TD U S K W IT H T H E GO O D S X Y

Message: MEET ME AT THE HOTEL AT DUSK WITH THE GOODS

Page 29: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Shortcom

ings of Transposition

•A

minor transm

ission error could garble the m

essage.

Page 30: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Substitution C

iphers

Page 31: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Sim

ple Substitution

D

efinition – letters are replaced by other letters or sym

bols.

S

imple substitution – 26! possible keys.

–P

ermutations of the alphabet.

26! =

26 * 25 * 24 * … * 2 * 1 ≅ 10

26 keys.

Plai

ntext: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Ciph

ertext:X Y L O P H N E Z W V U T S R Q M K J I G F D C B A

Page 32: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

The A

rgenti's of Rom

e

p i

e t r o a b c d f g h l m n q s u z

10 1

1 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

G

iovanni Battista A

rgenti – cipher secretary for P

ope Sixtus V

in 1589.

M

atteo Argenti (nephew

) – cipher secretary for 6 popes through 1602.

M

atteo authored 135-page cipher manual.

Invented m

nemonic keyw

ord technique:

Page 33: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Analyzing S

imple S

ubstitution

Recognizing sim

ple substitution.

–N

on-standard letter frequencies.

F

requency Analysis.

–G

iven enough text (> 50 letters).

–M

ost frequent cipher letters correspond to most

frequent plaintext letters.

O

ther Attacks.

P

robable word.

N

-gram – bigram

, trigram, etc.

Page 34: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Characteristics of E

nglish Text

H

igh Frequency G

roup:

E

T A

O N

I R S

H (70%

of text )

12 10 8 8 7 7 6 7 5 (individual %

)

T

O S

– frequent initial and final letters

A

I H – frequent initial but not final

E

N R

– frequently final but less so as initials.

Page 35: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Vow

el Solution M

ethod

C

ount letter frequencies.

Separate vow

els and consonants.

Vow

els are high frequency.

Identify individual vowels.

E

is most frequent;

E

almost never touches O

; EE

and OO

are relatively frequent;

A follow

s but never precedes E, etc.

Identify recognizable consonants.H

precedes and never follows vow

els; TH

and HE

and HA

are comm

on bigrams, etc.

Page 36: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

5 10 11

3 3

2 1

9 4 4 2 11 10 1 10 6 4 9 6 2

1 3

11

4 F D R

J N

U H

V X X U R D M D S K V S O

P J

R

K

----

-

--- 5 10 3

5 5

3 4

1 6 11 11 9 3 1 3 11 3 10 2 11

3 10

5

9 Z D Y

F Z

J X

G S R R V T Q Y R W D A R

W D

F

V -------

---

---- ------- ---

----

11 4

9 10 1

1 4

9 3 10 5 6 5 5 10 3 5 11 10 3 3

9 2

9 3

R K V

D R

K V

T D F S Z Z D Y F R D N N

V O

V

T -------

--

-----

----------

---

-

-----

6 4 6

2 3

9 5

11

S X S

A W

V Z

R

Frequ

ency Cou

nts-----

--------

---A B C

D E F

G H I

J K L M N O P Q R S T U V W X Y Z

2

10 5

1 1

3 4 1 3 2 1 1 11 6 3 2 9 3 4 3 5

High

Frequenc

y Con

tacts

-----

--------

-----

-----

R D

V

S F Z K X

D.J

F.R H

.X

D.K ..D K.D S.V V.X

U.D

R.M K

.S

V.O Y.Z F.J R.Z X.U

J.K

M.S R

.T

G.R D.V S.Z R.V J.G

S.R

Z.Y F

.R

F.Z D.S Z.D R.V S.S

R.V

W.A K

.D

T.X Y.R V.R

Y.W

W.F K

.T

X.A

A.W

V.R N

.OV.K

T.F O

.T

Low Frequency Contacts

D.K

Z.Y W

.Z

----------------------

F.D

R.N

G H M P Q

Z..

X.S U.V D.D O.J T.Y

Moder

ate Freq

uency

Contacts

-----

--------

-----

---------

J N

T

W

Y A O U

R.N

J.U V

.Q

R.D D.F D.R S.P N.H

P.R

D.N V

.D

R.D Q.R S.W V.V X.R

Z.X

N.V V

.S

A.V D.F

Helen F

ouche Gaines, p. 73ff.

Page 37: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Nom

enclator

from

Rossignol's

Great C

ipher

Resisting F

requency Analysis

Page 38: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

The N

omenclator

E

arly 15th – late 18

th centuries.

H

omophones – plaintext letters m

ap to more than

one ciphertext letter.

C

ode book – names of people and places are

replaced by a symbol.

B

reakable by mid 16

th century.

R

ossignol's Great C

ipher (1620s) wasn't broken until

1893 by Etienne B

azeries who guessed that sym

bols represented syllables and not letters.

Page 39: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Mary Q

ueen of S

cots C

ipher

Page 40: October 31, 2009 Smithsonian Institute · 2010. 4. 26. · Ciphers: Making and Breaking Ralph Morelli rinity College, Hartford (ralph.morelli@trincoll.edu) Smithsonian Institute October

Babington

Plot

Mary, Q

ueen of Scots1542-1587

Queen E

lizabeth1533-1603

Sir Francis Walsingham

1532-1590

Thom

as Babington

1561-1586

Mary Q

ueen of Scots Nom

enclator(Singh,The C

ode Book, p. 38