Coursework 1

Caesar Cipher: Exercise

Use the following relative frequencies in an English text of 1000 letters:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
73930441302816357423352578742737763932713165191

to decide the most likely shift used to obtain:

1K DKVO DYVN LI KX SNSYD, PEVV YP CYEXN KXN PEBI, CSQXSPISXQ XYDRSXQ.

Don’t just brute force but proceed strategically. Tally the frequencies of letters in the ciphertext.

ABCDEFGHIJKLMNOPQRSTUVWXYZ
1243341414316475

As X appears in the ciphertext 7 times and E is the most frequent letter in the given table, it is reasonable to assume that X = E. If X = E, we have a shift of . This would result in our cipher -> plaintext looking like this:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
HIJKLMNOPQRSTUVWXYZABCDEFG

Which gives this plaintext for the ciphertext:

1R KRCV KFCU SP RE ZUZFK, WLCC FW JFLEU REU WLIP, JZXEZWPZEX EFKYZEX.

which, doesn’t make any sense. Systematically you can then apply X = ? where ? is the next most frequent letter from the given table. This gives X = T and finally X = N where you’ll find:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
QRSTUVWXYZABCDEFGHIJKLMNOP

Which gives this plaintext for the ciphertext:

1A TALE TOLD BY AN IDIOT, FULL OF SOUND AND FURY, SIGNIFYING NOTHING.

The Playfair Cipher: Exercise

Use the keyword “CHARLES” to encrypt the plaintext

MEET ME AT HAMMERSMITH BRIDGE TONIGHT

First we construct our matrix with the keyword CHARLES:

We can then split the plaintext into pairs with Xs to fill repeated characters when necessary:

1ME ET ME AT HA MX ME RS MI TH BR ID GE TO NI GH TX

We can then cipher this to get:

1GD DO GD RQ AR KY GD HD NK PR DA MS OG UP GK IC QY

And decrypt to get:

1ME ET ME AT HA MX ME RS M(I/J) TH BR (I/J)D GE TO N(I/J) GH TX
2MEET ME AT HAMXMERSM(I/J)TH BR(I/J)DGE TON(I/J)GHTX
3MEET ME AT HAMMERSMITH BRIDGE TONIGHT

Viginère Cipher: Exercise

Use the tableu and keyword RELATIONS to encrypt TO BE OR NOT TO BE THAT IS THE QUESTION.

Steps:

  1. Find value for each character in key by using it’s index in the alphabet. i.e. R = 17, E = 4
  2. Perform Caesar cipher for each character in plaintext with each value, repeating key when necessary.
Key:RELATIONS
174110198141318

Encrypting TO BE OR NOT BE THAT IS THE QUESTION gives:

1Key:            RE LA TI ONS RE LA TION SR ELA TIONSREL
2Plain-text:     TO BE OR NOT TO BE THAT IS THE QUESTION
3Cipher-text:    KS ME HZ BBL KS ME MPOG AJ XSE JCSFLZSY

To decrypt:

1Cipher-text:    KS ME HZ BBL KS ME MPOG AJ XSE JCSFLZSY
2Key:            RE LA TI ONS RE LA TION SR ELA TIONSREL
3Plain-text:     TO BE OR NOT TO BE THAT IS THE QUESTION

The Viginère cipher presents an improvement over the Caesar cipher as it places a positional dependency on the cipher-text. It is isn’t immune to frequency attacks as you can see it is possible to guess the length of the key where there are reptitions in the cipher-text (there is ME encrypted for LA twice).

The Churchyard Cipher (Simplified): Exercise

alt text

What kind of cipher is it?

This is a mono-alphabetic cipher as each letter is mapped to one symbol/character in the ciphertext alphabet.

Why is it so difficult to break? (Especially without the hint!)

It is really difficult to break as it uses a ciphertext alphabet that we are not as familiar with.

What is the plaintext message?

So, after reading about the pigpen cipher and the tic-tac-toe hint; it’s clear that we can place our alphabet inside 3 tic-tac-toe grids and use the surrounding borders as an identifier for each letter; like so:

alt text

We can guess that the dots refer to which grid to use, but which one? We can easily find out by writing down each combination (there are only 3!):

1I E D E D B E T   D E A B H
2R N M N M K N R   M N J K Q
3_ W V W V T W _   V W S T _

From here, there is only one sensical phrase: REMEMBER DEATH.

What is the key?

From the above, this makes our key:

alt text

One-time pad: Exercise

Given two distinct cipher-texts that have used the same one-time pad, what technique could an attacker use to break them?

The attacker could perform the same pad operation on the cipher-texts to obtain some information about the key. Ideally he’d need to intercept more cipher-texts with the same one-time pad. <a href="https://drive.google.com/file/d/0B63hsaKyFcnQbElkd3BxVWNnRzA/view?usp=sharing" target="_blank">See coursework from QMUL (using XORs)</a>.