Playfair

Playfair is a great little code, and uses a 5×5 matrix, where we add the key at the start, and then place the rest of the letters (without repeating any). Next we take the plain text two characters at a time, and then draw a rectangle around then, and the other letters which bound the rectangle are then used. For example with a key of “playfair example” Theory

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

For example if we use:

hide the gold in the tree stump

with a key:

playfairexample

We get a matrix of:

playf
irexm
bcdgh
knoqs
tuvwz

The first step is to split into two character strings:

hi de th eg ol di nt he tr ee st um p

First “hi” gives:

-----
i---m
b---h
-----
-----

to give “bm”. The final mapping is then:

bm od zb xd na be ku dm ui xm mo uv if

Presentation

http://www.asecuritysite.com/Coding/playfair?word=Hide%20the%20gold%20in%20the%20tree%20stump%2Cplayfairexample

There are more details at:

http://www.asecuritysite.com/Coding/playfair

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