The PlayFair Cipher

The Hill Cipher

The Four Square Cipher

EverCrack Home

The Playfair Cipher [actually invented by Charles Wheatstone]

is a polygraphic, monoalphabetic substitution cipher - that is, more than one

plain text letter is encrypted at a time [in this case two, making it di-

graphic]. into two cipher text letters, or symbols, at a time [making it

uniliteral].

The process of encryption involves an encrypting matrix and a

set of simple rules:

K

E

Y

A

B

C

D

F

G

H

I

J

L

M

N

O

P

R

S

T

U

V

W

X

Z

Generally, like the Polybius Cipher , one letter is omitted to

accommodate the matrix [in this case "Q"]and a keyword salts the insertion of

the alphabet [in this case "KEY" - thus omitting the occurrence of those letters

in the rest of the matrix].

Using our clear text message: T H I S I S A S E C R E T M E S S A G E

The message is broken into pairs of two: TH IS IS AS EC RE TM ES SA GE

We apply the following rules:

1) If the two letters are the same [none in this case] you add

an "X" [or any arbitrary letter] to the first letter and then encrypt the new

pair and proceed...

2) If the letters appear on the same row of the matrix you

replace those letters with the letter directly to its right

3) If the letters appear on the same column of the matrix you

replace those letters with the letter directly beneath

4) Otherwise, form a rectangle between the two letters and re-

place them with the letters on the same but at the opposite end of the rectangle

In this case we have the following encrypts:

TH = ZN [same column, rule #3]

IS = MO [rule #4]

IS = MO [rule #4]

AS = GX [rule #3]

EC = KD [rule #4]

RE = PY [rule #4]

TM = SN [rule #4]

ES = AP [rule #4]

SA = XG [rule #3]

GE = DA [rule #4]

with the resulting cipher text: ZN MO MO GX KD PY SN AP XG DA

Technically, the resulting cipher text has the surface

appearance of a polyalphabetic substitution cipher - for the fact that "T" is

encrypted as "Z" at one point but "S" in another point. However, this would be

a false lead - since no polyalphabetic cipher alphabet was used [nor a corre-

sponding key] you would be at loss to find a consistent decode. This particular

cipher would require digraph analysis [albeit, the missing "Q" would throw a

monkey wrench in the process].

The Hill Cipher, invented by Lester Hill, is a polygraphic,

monoalphabetic substutition cipher. The Hill Cipher uses matrix multipication

to encipher.

Clear Message: H E Y X ["X" appended as a pad]

converted to decimal (mod 26): 7 4 24

and the matrix [N x N where N equals the number of characters] of mod-26 is the key:

Matrix Clear Message [last column]

1

3

5

7

*

7

*

4

*

24

*

23

"HE" is encrypted by summing the products of the first two key

numbers [1, 3] with the decimal equivalents for "H" and "E" [7, 4]:

(1 * 7) + (3 * 4) = 19 = T

and then summing the products of the second two key numbers [5, 7] with the

decimal equivalents for "H" and "E" [7,4]:

(5 * 7) + (7 * 4) = 63 = 11 (mod-26) = L

so "HE" encrypts to "TL"...

"YX" is encrypted by summing the products of the first two key numbers [1, 3]

with the decimal equivalents for "Y" and "X" [24, 23]:

(1 * 24) + (3 * 23) = 93 = 15 (mod-26) = P

and then summing the products of the second two key numbers [5, 7] with the

decimal equivalents fo "Y" and "X" [24,23]:

(5 * 24) + (7 * 23) = 281 = 21 (mod-26) = V

with the final output: T L P V

The Four Square Cipher is also a polygraphic, monoalphabetic

substitution cipher. Specifically, it encrypts digraphs [pairs of letters]. The

encrypting device consists of four 5 x 5 squares [omitting an arbitrary letter,

in this case Q] with the two plain alphabets in the top-left and bottom-right

corners:

A

B

C

D

E

C

R

A

K

B

F

G

H

I

J

D

E

F

G

H

K

L

M

N

O

I

J

L

M

N

P

R

S

T

U

O

P

S

T

U

V

W

X

Y

Z

V

W

X

Y

Z

T

H

I

S

A

A

B

C

D

E

B

C

D

E

F

F

G

H

I

J

G

J

K

L

M

K

L

M

N

O

N

O

P

R

U

P

R

S

T

U

V

W

X

Y

Z

V

W

X

Y

Z

To encrypt the message: T H I S I S A S E C R E T M E S S A G E

you locate the "T" in the upper-left alphabet and the "H" in the lower right

alphabet and find the intersection in the upper-right cipher alphabet "S", then

find the intersection in the bottom-left cipher alphabet "E", so the first part

of the message encrypts to "SE". This is repeated yielding the following cipher

text: SE FR FR AN AA UH SL AU OI HH

[Return to Evercrack Main]