27
“How Do You Say ‘Cryptography’ in Romanian?” Learning About Integers from Ciphers in Different Languages Joshua Holden Rose-Hulman Institute of Technology http://www.rose-hulman.edu/~holden Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 1 / 16

How Do You Say 'Cryptography' in Romanian?

Embed Size (px)

Citation preview

Page 1: How Do You Say 'Cryptography' in Romanian?

“How Do You Say ‘Cryptography’ in Romanian?”Learning About Integers from Ciphers in Different

Languages

Joshua Holden

Rose-Hulman Institute of Technologyhttp://www.rose-hulman.edu/~holden

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 1 / 16

Page 2: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cdefghijklmnopqrstuvwxyz

ciphertext: CJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 3: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fghijklmnopqrstuvwxyz

ciphertext: CFJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 4: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijklmnopqrstuvwxyz

ciphertext: CFIJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 5: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijk /lmnopqrstuvwxyz

ciphertext: CFILJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 6: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijk /lmn /opqrstuvwxyz

ciphertext: CFILOJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 7: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijk /lmn /opq/rstuvwxyz

ciphertext: CFILORJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 8: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijk /lmn /opq/rst/uvwxyz

ciphertext: CFILORUJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 9: How Do You Say 'Cryptography' in Romanian?

Decimation ciphers

The decimation cipher goes back at least as far as 1935.

Pick a key, say 3. Start by writing out the plaintext (original message)alphabet.

Example

plaintext: abcdefghijklmnopqrstuvwxyz

Count off every third letter, crossing them out (or “decimating” them)and writing them below as our ciphertext (encrypted message)alphabet.

Example

plaintext: ab/cde/fgh/ijk /lmn /opq/rst/uvw/xyz

ciphertext: CFILORUXJoshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 2 / 16

Page 10: How Do You Say 'Cryptography' in Romanian?

Wrap around

When you get to the end, “wrap around” to the beginning.1 In thiscase, cross out the “a” and keep going.

Example

plaintext: ab/cde/fgh/ijk /lmn /opq/rst/uvw/xyz

ciphertext: CFILORUX

1There is an alternative which may be older but is not as pretty.Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 3 / 16

Page 11: How Do You Say 'Cryptography' in Romanian?

Wrap around

When you get to the end, “wrap around” to the beginning.1 In thiscase, cross out the “a” and keep going.

Example

plaintext: /ab/cde/fgh/ijk /lmn /opq/rst/uvw/xyz

ciphertext: CFILORUXA

1There is an alternative which may be older but is not as pretty.Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 3 / 16

Page 12: How Do You Say 'Cryptography' in Romanian?

Wrap around

When you get to the end, “wrap around” to the beginning.1 In thiscase, cross out the “a” and keep going.

Example

plaintext: /ab/c/de/f/gh/i//jk /l /mn /o/pq/r/st/u/vw/x/yz

ciphertext: CFILORUXADGJMPSVY

1There is an alternative which may be older but is not as pretty.Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 3 / 16

Page 13: How Do You Say 'Cryptography' in Romanian?

Wrap it up

Finally, wrap around to the “b” and finish up:

Example

plaintext: /ab/c/de/f/gh/i//jk /l /mn /o/pq/r/st/u/vw/x/yz

ciphertext: CFILORUXADGJMPSVY

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 4 / 16

Page 14: How Do You Say 'Cryptography' in Romanian?

Wrap it up

Finally, wrap around to the “b” and finish up:

Example

plaintext: /a/b/c/de/f/gh/i//jk /l /mn /o/pq/r/st/u/vw/x/yz

ciphertext: CFILORUXADGJMPSVYB

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 4 / 16

Page 15: How Do You Say 'Cryptography' in Romanian?

Wrap it up

Finally, wrap around to the “b” and finish up:

Example

plaintext: /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

ciphertext: CFILORUXADGJMPSVYBEHKNQTWZ

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 4 / 16

Page 16: How Do You Say 'Cryptography' in Romanian?

Be fruitful

So our final translation of plaintext to ciphertext is:

Example

plaintext: abcdefghijklmnopqrstuvwxyzciphertext: CFILORUXADGJMPSVYBEHKNQTWZ

and an example message might be:

Example

plaintext: befruitfulandmultiplyciphertext: FORBKAHRKJCPLMKJHAVJW

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 5 / 16

Page 17: How Do You Say 'Cryptography' in Romanian?

Letters to numbers

How can we describe the decimation method in terms of modulararithmetic? We should translate our numbers into letters, of course.

Example

plaintext: a b c d e f g h i j · · ·numbers: 1 2 3 4 5 6 7 8 9 10 · · ·

some operation?: 3 6 9 12 15 18 21 24 1 4 · · ·ciphertext: C F I L O R U X A D · · ·

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 6 / 16

Page 18: How Do You Say 'Cryptography' in Romanian?

Multiplicative cipher

And now we see that a decimation cipher is the same as a“multiplicative cipher” with multiplication by 3 modulo 26:

Example

plaintext number times 3 ciphertexta 1 3 Cb 2 6 F...

......

...y 25 23 Wz 26 26 Z

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 7 / 16

Page 19: How Do You Say 'Cryptography' in Romanian?

Bad Keys

Are there any keys we can’t use? Think about multiplying by 2 — weknow that any number multiplied by 2 is even. A multiplicative cipherwith a key of 2 looks like:

Example

plaintext number times 2 ciphertexta 1 2 Bb 2 4 D...

......

...m 13 26 Zn 14 2 Bo 15 4 D...

......

...z 26 26 Z

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 8 / 16

Page 20: How Do You Say 'Cryptography' in Romanian?

Phi

So even keys are bad, and so is one other. (Which one?)

In fact, the bad keys are exactly those which have a common factorwith 26. Or, to put it another way:

FactThe good keys for the multiplicative cipher are the numbers between 1and 26 which are relatively prime to 26.

These good keys are counted by the Euler phi function, which is veryimportant in number theory (and cryptography):

φ(n) = # {1 ≤ k ≤ n : gcd(k ,n) = 1}

φ(26) = 12, so there are 12 good keys for this cipher.

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 9 / 16

Page 21: How Do You Say 'Cryptography' in Romanian?

Aloha

Clearly, losing more than half of our keys can’t be good!

We could solve the problem in a terribly extreme way by getting rid ofthe English language altogether and using a language with an oddnumber of letters.

The Hawaiian alphabet, for instance, has 13:

plaintext: aeiouhklmnpw‘

(Yes, that last symbol is a letter.)

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 10 / 16

Page 22: How Do You Say 'Cryptography' in Romanian?

Two can be good, too!

So the multiplicative cipher with a key of 2 in Hawaiian looks like:

plaintext number times 2 ciphertexta 1 2 Ee 2 4 Oi 3 6 Ho 4 8 Lu 5 10 Nh 6 12 Wk 7 1 Al 8 3 Im 9 5 Un 10 7 Kp 11 9 Mw 12 11 P‘ 13 13 ‘

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 11 / 16

Page 23: How Do You Say 'Cryptography' in Romanian?

Hawaiian keys

How many good keys are there for decimation ciphers in Hawaiian?Since 13 is prime, every key except 13 itself is good.

φ(13) = 12 good keys, same as in English.

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 12 / 16

Page 24: How Do You Say 'Cryptography' in Romanian?

The formula for phi

A nice application of the inclusion-exclusion principle can be used toprove:

Theorem

If n = pe11 · · · p

ett then

φ(n) =(

pe11 − pe1−1

1

)· · ·

(pet

t − pet−1t

).

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 13 / 16

Page 25: How Do You Say 'Cryptography' in Romanian?

Danish, anyone?

So for English, we have φ(26) = (2− 1)(13− 1) = 12 good keys.

For Hawaiian, φ(13) = (13− 1) = 12, also.

Spanish has 27 letters and φ(27) = (27− 9) = 18 good keys.

Romanian has 28 letters and φ(28) = (4− 2)(7− 1) = 12 good keys.

Danish, Norwegian, and Swedish all have 29 letters andφ(29) = (29− 1) = 28 good keys.

So clearly we should be sending our secret messages in Scandinavianlanguages!

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 14 / 16

Page 26: How Do You Say 'Cryptography' in Romanian?

Further developments

There is lots of other modular arithmetic that can be motivated in thisway.

You may see some of it (fixed points) in the next talk.

But if you only look at it in English, you only get to see one modulus!

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 15 / 16

Page 27: How Do You Say 'Cryptography' in Romanian?

EILWE ‘LO

and thanks for listening!

Joshua Holden (RHIT) “How Do You Say ‘Cryptography’?” 16 / 16