Here’s how the Union enciphered its messages during the Civil War. Abraham Lincoln sent this dispatch on June 1, 1863:
GUARD ADAM THEM THEY AT WAYLAND BROWN FOR KISSING VENUS CORRESPONDENTS AT NEPTUNE ARE OFF NELLY TURNING UP CAN GET WHY DETAINED TRIBUNE AND TIMES RICHARDSON THE ARE ASCERTAIN AND YOU FILLS BELLY THIS IF DETAINED PLEASE ODOR OF LUDLOW COMMISSIONER
The first word, GUARD, indicates the size of a containing rectangle and the paths on which the words must be laid out to decipher the message. In this case, they’ll go up the first column, down the second, up the fifth, down the fourth, and up the third. Also, just to confuse the Confederates, every eighth word after GUARD is a null and should be discarded. So we get:
FOR VENUS LUDLOW RICHARDSON AND
BROWN CORRESPONDENTS OF THE TRIBUNE
WAYLAND AT ODOR ARE DETAINED
AT NEPTUNE PLEASE ASCERTAIN WHY
THEY ARE DETAINED AND GET
THEM OFF IF YOU CAN
ADAM NELLY THIS FILLS UP
The last steps are to remove THIS FILLS UP, which is only there to fill out the block, and to replace a few code words:
VENUS = colonel
WAYLAND = captured
ODOR = Vicksburg
NEPTUNE = Richmond
ADAM = President of the United States
NELLY = 4:30 p.m.
That gives us the final message:
For Colonel Ludlow,
Richardson and Brown, correspondents of the Tribune, captured at Vicksburg, are detained at Richmond. Please ascertain why they are detained and get them off if you can.
The President, 4:30 p.m.
This system was such a valuable source of breaking news that Lincoln often visited the military telegraph office in the War Department, next to the White House, and would chat with the operators there. One of them, David Homer Bates, who was only 18 when the war started, remembered, “Outside the members of his cabinet and his private secretaries, none were brought into closer or more confidential relations with Lincoln than the cipher-operators, … for during the Civil War the President spent more of his waking hours in the War Department telegraph office than in any other place, except the White House. … His tall, homely form could be seen crossing the well-shaded lawn between the White House and the War Department day after day with unvaried regularity.”
(From David Kahn, The Codebreakers, 1996.)