© Francisco Ruiz, 2016
This page extends the Snake cipher, by F. Ruiz, so it can be used with relatively short keys (hence the name) rather than keys three times the length of the plaintext. Snake simplified the paper-and-pencil TripleText cipher, also by F. Ruiz, so the Tabula Recta was used more efficiently. All steps can be performed by hand without excessive effort.
While Snake uses a non-repeating key text three times the length of the plaintext in order to generate the keystream, Worm uses a short repeating seed, as in the so-called Vigenère cipher, plus the plaintext and the ciphertext themselves after a delay equal to the length of the seed. After a short initial phase, letters are combined in groups of four as in the Snake cipher. The Tabula Recta includes a substitution determined by the main key (which can be different from the seed). This cipher is reciprocal like its predecessor, meaning that the process is identical for encryption and decryption. Unlike Snake, the Worm cipher can take a key or a seed that has been used before.
After the plaintext or ciphertext is processed —spaces and punctuation are stripped, and all letters are converted to capitals; accented letters are replaced by their non-accented versions; numbers in plaintext are converted to letters as in 0=A,1=B,...9=J, but are not converted back— two additional rows are written below it to make a work table. Second row is the seed, repeated as many times as needed to equal the length of the plaintext. Third row is the ciphertext, which is computed differently while the number of its characters does not exceed the seed length (initial phase), this way:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
--------------------------------------------------- A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | A B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A | B C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B | C D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C | D E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D | E F | F G H I J K L M N O P Q R S T U V W X Y Z A B C D E | F G | G H I J K L M N O P Q R S T U V W X Y Z A B C D E F | G H | H I J K L M N O P Q R S T U V W X Y Z A B C D E F G | H I | I J K L M N O P Q R S T U V W X Y Z A B C D E F G H | I J | J K L M N O P Q R S T U V W X Y Z A B C D E F G H I | J K | K L M N O P Q R S T U V W X Y Z A B C D E F G H I J | K L | L M N O P Q R S T U V W X Y Z A B C D E F G H I J K | L M | M N O P Q R S T U V W X Y Z A B C D E F G H I J K L | M N | N O P Q R S T U V W X Y Z A B C D E F G H I J K L M | N O | O P Q R S T U V W X Y Z A B C D E F G H I J K L M N | O P | P Q R S T U V W X Y Z A B C D E F G H I J K L M N O | P Q | Q R S T U V W X Y Z A B C D E F G H I J K L M N O P | Q R | R S T U V W X Y Z A B C D E F G H I J K L M N O P Q | R S | S T U V W X Y Z A B C D E F G H I J K L M N O P Q R | S T | T U V W X Y Z A B C D E F G H I J K L M N O P Q R S | T U | U V W X Y Z A B C D E F G H I J K L M N O P Q R S T | U V | V W X Y Z A B C D E F G H I J K L M N O P Q R S T U | V W | W X Y Z A B C D E F G H I J K L M N O P Q R S T U V | W X | X Y Z A B C D E F G H I J K L M N O P Q R S T U V W | X Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X | Y Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y | Z ---------------------------------------------------
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Example 2-letter operations with straight alphabet: R + H = Q, E + W = S. Example 4-letter operations: Z + A + J + X = P, M + I + N + E = N.
The main key is for making the mixed alphabet at the top, bottom, and sides of the Tabula Recta. Do this to make a scrambled alphabet: 1, take the key and write down new letters in the order they appear; if a letter in the text key has already been written, write instead the immediately preceding letter before it in the alphabet that is still available (wrap around to the end if needed); 2, then write the rest of the alphabet in reverse order.
If you want to use a seed different from the key, write it in this box. Otherwise the key will be used as seed:
For best security when encrypting, prepend a number of random characters (nulls) equal to the seed length
Now the message to be encrypted is converted to what follows after spaces, punctuation and diacritics are removed, and everything is turned into lowercase:
The next step is to obtain the ciphertext (plaintext, if decrypting). We generate the table below, following the instructions at the top of this page. The third row cannot be made right away but only after the computation has started, but here you will see it in its final state. The output (ciphertext or plaintext) is the third row. Some statistics will be displayed below the table.
Information about output randomness will appear here
The ciphertext (plaintext when decrypting) is repeated in the first box below. The lower box contains the same after splitting into codegroups of five characters each.