teaching the group theory of permutation ciphers

25
Teaching the Group Theory of Permutation Ciphers Joshua Holden Rose-Hulman Institute of Technology http://www.rose-hulman.edu/~holden Joshua Holden (RHIT) Group Theory of Permutation Ciphers 1 / 13

Upload: joshua-holden

Post on 15-Jun-2015

246 views

Category:

Documents


0 download

DESCRIPTION

One of the first topics often taught in an abstract algebra class is permutations, since they provide good examples of non-commutative finite groups which the students can manipulate and visualize. This visualization is often done through symmetry groups. For students who are less geometrically inclined, however, the use of permutation ciphers provides another good way of motivating permutations. They can easily be used to illustrate composition, non-commutativity, inverses, and the order of group elements, which are fundamental topics in group theory. We will give examples of how this can be done and suggest other courses besides abstract algebra in which this could also prove useful.

TRANSCRIPT

Page 1: Teaching the Group Theory of Permutation Ciphers

Teaching the Group Theory of Permutation Ciphers

Joshua Holden

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

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 1 / 13

Page 2: Teaching the Group Theory of Permutation Ciphers

A historical example

Taj ad-Din Ali ibn ad-Duraihim (1312–1361), worked and taught inDamascus and Cairo.

In a book that was considered lost until the late 20th century, ibnad-Duraihim described 24 variations of transposition ciphers.

Example

plaintext: dr in kt ot he ro seciphertext: RD NI TK TO EH OR ES

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 2 / 13

Page 3: Teaching the Group Theory of Permutation Ciphers

So what?

We are seeing the first explicit example of a permutation cipher.

DefinitionA permutation is a bijection from a finite set to itself.

Example

plaintext: dr in kt ot he ro seciphertext: RD NI TK TO EH OR ES

Ibn ad-Duraihim’s permutation is(

1 22 1

).

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 3 / 13

Page 4: Teaching the Group Theory of Permutation Ciphers

Another example

Exampleplaintext: ruby wineciphertext: UYBR IENW

This is a cipher based on the permutation(

1 2 3 42 4 3 1

).

NoteSome people prefer to use a notation based on where the letters go.We will use one based on where they come from.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 4 / 13

Page 5: Teaching the Group Theory of Permutation Ciphers

Keys and keywords

Clearly the key to a permutation cipher is the permutation.

We can choose and remember a permutation by a keyword.

Example

TALE is a keyword for the permutation(

1 2 3 42 4 3 1

).

4132 4132 4132 4132 4132keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nllu

ciphertext: HPET PREA NTDA EEPH LULN

HPETP REANT DAEEP HLULN

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 5 / 13

Page 6: Teaching the Group Theory of Permutation Ciphers

Keys and keywords

Clearly the key to a permutation cipher is the permutation.

We can choose and remember a permutation by a keyword.

Example

TALE is a keyword for the permutation(

1 2 3 42 4 3 1

).

4132 4132 4132 4132 4132

keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nllu

ciphertext: HPET PREA NTDA EEPH LULN

HPETP REANT DAEEP HLULN

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 5 / 13

Page 7: Teaching the Group Theory of Permutation Ciphers

Keys and keywords

Clearly the key to a permutation cipher is the permutation.

We can choose and remember a permutation by a keyword.

Example

TALE is a keyword for the permutation(

1 2 3 42 4 3 1

).

4132 4132 4132 4132 4132keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nllu

ciphertext: HPET PREA NTDA EEPH LULN

HPETP REANT DAEEP HLULN

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 5 / 13

Page 8: Teaching the Group Theory of Permutation Ciphers

Keys and keywords

Clearly the key to a permutation cipher is the permutation.

We can choose and remember a permutation by a keyword.

Example

TALE is a keyword for the permutation(

1 2 3 42 4 3 1

).

4132 4132 4132 4132 4132keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nlluciphertext: HPET PREA NTDA EEPH LULN

HPETP REANT DAEEP HLULN

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 5 / 13

Page 9: Teaching the Group Theory of Permutation Ciphers

Keys and keywords

Clearly the key to a permutation cipher is the permutation.

We can choose and remember a permutation by a keyword.

Example

TALE is a keyword for the permutation(

1 2 3 42 4 3 1

).

4132 4132 4132 4132 4132keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nlluciphertext: HPET PREA NTDA EEPH LULN

HPETP REANT DAEEP HLULN

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 5 / 13

Page 10: Teaching the Group Theory of Permutation Ciphers

Deciphering

In order to decipher, you need to take the inverse of the permutation.

The inverse of(

1 2 3 42 4 3 1

)is(

1 2 3 44 1 3 2

).

NoteWe saw the numbers 4132 earlier!

Equivalently, alphabetize the keyword and read off the plaintext inoriginal keyword order:

Example

2431 2431 2431 2431 2431keyword: AELT AELT AELT AELT AELT

ciphertext: HBET TLTA ADNE HSET ODRW

plaintext: theb attl eand thes word

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 6 / 13

Page 11: Teaching the Group Theory of Permutation Ciphers

Deciphering

In order to decipher, you need to take the inverse of the permutation.

The inverse of(

1 2 3 42 4 3 1

)is(

1 2 3 44 1 3 2

).

NoteWe saw the numbers 4132 earlier!

Equivalently, alphabetize the keyword and read off the plaintext inoriginal keyword order:

Example

2431 2431 2431 2431 2431

keyword: AELT AELT AELT AELT AELT

ciphertext: HBET TLTA ADNE HSET ODRW

plaintext: theb attl eand thes word

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 6 / 13

Page 12: Teaching the Group Theory of Permutation Ciphers

Deciphering

In order to decipher, you need to take the inverse of the permutation.

The inverse of(

1 2 3 42 4 3 1

)is(

1 2 3 44 1 3 2

).

NoteWe saw the numbers 4132 earlier!

Equivalently, alphabetize the keyword and read off the plaintext inoriginal keyword order:

Example

2431 2431 2431 2431 2431keyword: AELT AELT AELT AELT AELT

ciphertext: HBET TLTA ADNE HSET ODRW

plaintext: theb attl eand thes word

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 6 / 13

Page 13: Teaching the Group Theory of Permutation Ciphers

Deciphering

In order to decipher, you need to take the inverse of the permutation.

The inverse of(

1 2 3 42 4 3 1

)is(

1 2 3 44 1 3 2

).

NoteWe saw the numbers 4132 earlier!

Equivalently, alphabetize the keyword and read off the plaintext inoriginal keyword order:

Example

2431 2431 2431 2431 2431keyword: AELT AELT AELT AELT AELT

ciphertext: HBET TLTA ADNE HSET ODRWplaintext: theb attl eand thes word

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 6 / 13

Page 14: Teaching the Group Theory of Permutation Ciphers

How many keys?

The number of keys for a permutation cipher on n letters is the numberof permutations, n!.

But one of them gives the trivial cipher:

Example

1234 1234keyword: ABCD ABCD

plaintext: ruby wine

ciphertext: RUBY WINE

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 7 / 13

Page 15: Teaching the Group Theory of Permutation Ciphers

How many keys?

The number of keys for a permutation cipher on n letters is the numberof permutations, n!.

But one of them gives the trivial cipher:

Example

1234 1234

keyword: ABCD ABCD

plaintext: ruby wine

ciphertext: RUBY WINE

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 7 / 13

Page 16: Teaching the Group Theory of Permutation Ciphers

How many keys?

The number of keys for a permutation cipher on n letters is the numberof permutations, n!.

But one of them gives the trivial cipher:

Example

1234 1234keyword: ABCD ABCD

plaintext: ruby wine

ciphertext: RUBY WINE

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 7 / 13

Page 17: Teaching the Group Theory of Permutation Ciphers

How many keys?

The number of keys for a permutation cipher on n letters is the numberof permutations, n!.

But one of them gives the trivial cipher:

Example

1234 1234keyword: ABCD ABCD

plaintext: ruby wineciphertext: RUBY WINE

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 7 / 13

Page 18: Teaching the Group Theory of Permutation Ciphers

Double encipherment?

Can we improve the security of a permutation cipher by using twodifferent keys?

Example

4132 4132 4132 4132 4132keyword: TALE TALE TALE TALE TALE

plaintext: thep aper andt hepe nllufirst ciphertext: HPET PREA NTDA EEPH LULN

4312 4312 4312 4312 4312keyword: POEM POEM POEM POEM POEM

first ciphertext: hpet prea ntda eeph lulnsecond ciphertext: ETPH EARP DATN PHEE LNUL

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 8 / 13

Page 19: Teaching the Group Theory of Permutation Ciphers

But look:Example

plaintext: thep aper andt hepe nllusecond ciphertext: ETPH EARP DATN PHEE LNUL

This is the same as if you had just used the key(

1 2 3 43 1 4 2

).

The combination of two ciphers is called a product cipher.

In fact: (1 2 3 42 4 3 1

)×(

1 2 3 43 4 2 1

)=

(1 2 3 43 1 4 2

).

NoteNot everyone writes permutation products in the same order, either.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 9 / 13

Page 20: Teaching the Group Theory of Permutation Ciphers

Noncommutativity

Note that (1 2 3 42 4 3 1

)×(

1 2 3 43 4 2 1

)is not the same as (

1 2 3 43 4 2 1

)×(

1 2 3 42 4 3 1

).

(I.e., permutation products are not commutative.)

If you don’t believe it, try encrypting our plaintext using the keywordPOEM first and then the keyword TALE.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 10 / 13

Page 21: Teaching the Group Theory of Permutation Ciphers

Bad keys

Some ciphers have bad keys — they don’t decrypt properly.

Example(1 2 3 44 1 1 3

)looks like a permutation, but...

plaintext: garb agei ngar bage outx

ciphertext: BGGR IAAE RNNA EBBG XOOTplaintext: g?rb a?ei n?ar b?ge o?tx

It’s a function but not a permutation — it doesn’t have an inverse.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 11 / 13

Page 22: Teaching the Group Theory of Permutation Ciphers

Bad keys

Some ciphers have bad keys — they don’t decrypt properly.

Example(1 2 3 44 1 1 3

)looks like a permutation, but...

plaintext: garb agei ngar bage outxciphertext: BGGR IAAE RNNA EBBG XOOT

plaintext: g?rb a?ei n?ar b?ge o?tx

It’s a function but not a permutation — it doesn’t have an inverse.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 11 / 13

Page 23: Teaching the Group Theory of Permutation Ciphers

Bad keys

Some ciphers have bad keys — they don’t decrypt properly.

Example(1 2 3 44 1 1 3

)looks like a permutation, but...

plaintext: garb agei ngar bage outxciphertext: BGGR IAAE RNNA EBBG XOOT

plaintext: g?rb a?ei n?ar b?ge o?tx

It’s a function but not a permutation — it doesn’t have an inverse.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 11 / 13

Page 24: Teaching the Group Theory of Permutation Ciphers

Group theory

Okay, what about the math? So far we’ve actually covered:

An example of a group, the permutation (cipher)s on n letters.(Actually, infinitely many groups!)

The order of the group (number of keys).

The group identity, the trivial permutation (cipher).

Inverses in the group, i.e. decryption.

The group operation, permutation (cipher) products.

Noncommutativity — permutations are not commutative, andneither are permutation ciphers.

A set which contains a group, but is not a group, because it is notclosed under inverses, i.e. functions.

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 12 / 13

Page 25: Teaching the Group Theory of Permutation Ciphers

HNAT SOFK LSIR EINT GZXN

NOJET EHYET EMNSG IEOUA

Joshua Holden (RHIT) Group Theory of Permutation Ciphers 13 / 13