# Bifid Coding

## Bifid Code

First we start with a grid [Theory]:

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

Next we look up the grid, and the arrange the two character values into two rows. For example is we have a plaintext of "maryland", then "m" is "4" and "5", so we place "4" in the first row, and "5" in the second row, and continue to do this for all the letters:

maryland 43554322 53533334

Next we read along the rows and merge, to give:

43 55 43 22 53 53 33 34

Next we convert them back to letters from the grid:

L R L P Y Y A X

Let’s try the reverse, with DXETE. For we look up the grid to get:

24 34 35 51 35

We can then put then into rows to give:

2 4 3 4 3 5 5 1 3 5

This gives us 25 (s) 45 (m), 31 (i) 43 (l) 35 (e) – which is **smile**.