Play Fair

My introduction into the world of ciphers began with the Playfair cipher.  It’s beautiful because it’s brilliantly difficult to crack – yet, as Wheatstone, the puzzle’s inventor, boasted – a schoolboy could learn to use it within fifteen minutes.

All you need to know in order to solve or create a Playfair cipher is the keyword, how to construct the 5 by 5 word table, and four relatively simple rules.

To create the table, you fill in the first spaces with your keyword with no repeating letters, then fill in the rest of the alphabet in order minus the letter “Q.”

Exempli gratia: (Keyword: DANGER)

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

At this point, you can go ahead and write your message out: “NOTE TO SELF: UPDATE BLOG POST ABOUT THE CHEESES”

You can now split your message into 2-letter segments called digraphs, taking into account…

Rule 1: if you have the same letter two times in a row (or only one letter left), add an “X” after the first letter.

So at this point your message should look like this:

NO  TE  TO  SE  LF  UP  DA  TE  BL  OG  PO  ST  AB  OU  TX  TH  EC  HE  ES  ES

Still legible – but ready to encrypt!

Here’s where the rest of the rules and the chart become important.

Rule 2: If the two letters appear in the same row – replace each with the letter immediately to the right – wrapping around to the left if the letter is on the far right.

Rule 3: If the two letters share a column, replace each with the letter immediately below it, wrapping around to the top if the letter is on the bottom.

Rule 4: Here’s where it gets tricky. Simonsingh.net provides a good explanation:

If the digraph letters are neither in the same row nor the same column, the rule differs. To encipher the first letter, look along its row until you reach the column containing the second letter; the letter at this intersection replaces the first letter. To encipher the second letter, look along its row until you reach the column containing the first letter; the letter at the intersection replaces the second letter.

But it makes the most sense when put in practice. Here’s an example of how I would begin to encrypt my message:

“NO”

D   A   N   G   E

R   B   C   F   H

I     J   K   L   M

O   P   S   T   U

V   W   X   Y   Z

becomes “DS”

“TE”

D   A   N   G   E

R   B   C   F   H

I     J   K   L   M

O   P   S   T   U

V   W   X   Y   Z

becomes “UG”

“TO”

D   A   N   G   E

R   B   C   F   H

I     J   K   L   M

O   P   S   T   U

V   W   X   Y   Z

becomes “UP”

“SE”

D   A   N   G   E

R   B   C   F   H

I     J   K   L   M

O   P   S   T   U

V   W   X   Y   Z

becomes “UN”

“LF”

D   A   N   G   E

R   B   C   F   H

I     J   K   L   M

O   P   S   T   U

V   W   X   Y   Z

becomes “TL”

Ergo, with the keyword “DANGER,” “Note to self” becomes “DSUGUPUNTL”

Sources:

http://www.simonsingh.net/The_Black_Chamber/playfair_cipher.html

Simon Singh provides a little more background about the cipher and an online encryption/decryption tool.

http://en.wikipedia.org/wiki/Playfair_cipher

Wikipedia has an excellent visual tutorial under “Example”

Questions:

  • How can you use ciphers in everyday life?
  • Why are some ciphers more difficult to crack then others?
  • What are some secrets that changed history? Who kept them, why, and how do we know them today?
  • How has the art of sending secret messages changed with the development of new technology?
  • Where do hidden messages show up in pop culture?

Leave a reply below!

………………………………

BONUS:

A song or two about the keeping of secrets:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s