© Francisco Ruiz, 2016
This is a cipher based directly on John F. Byrne's Chaocipher from 1918, which was kept secret for many years and finally revealed in 2010. It extends Chaocipher so that the alphabet letter to be moved to the nadir position can be varied rather than always use the same. It also applies a transposition after the main encryption process in order to defeat a known plaintext attack. There are, therefore, three keys plus two numerical values in the 0-25 range, for a total key space of size 26!^3*26^2 = 4.4E82, equivalent to 275 binary bits. The name is because it can be most easily implemented using Scrabble tiles placed on either side of a ruler.
We begin by making scrambled alphabets out of the keys. This is why we input the keys before the plaintext. The boxes are blue to indicate that they can be written on. Do this to make a scrambled alphabet: take each key and write the different letters of the alphabet in the order they appear in the key, if a letter has been used already, write instead the immediately preceding letter in the normal alphabet not yet chosen. If there are letters that did not appear in the key, write them now in reverse alphabetical order (keys 1 and 2 only).
It is OK to use keys that have been used before, even for a message of identical length as a previous message. In this program, if you leave the key 2 or key 3 boxes empty, key 1 will be used also in those roles. Write a single letter in the key 3 box to turn off transposition.
So here are the initial mixed alphabets produced by processing the keys. If you are using Scrabble tiles, make the first two alphabets on either side of a ruler (I usually put the plaintext alphabet above it and the ciphertext alphabet below it, but this doesn't really matter), with the first letter of each lined up with the zero position:
In this implementation, we are using variable positions for the letters that get moved and where they end up. Defaults are for Chaocipher: third letter or position 2 moving to position 13 for plaintext alphabet, second or position 1 moving to position 13 for ciphertext alphabet. Better values are: no move for plaintext alphabet, first letter to position 11 for ciphertext alphabet. We also have the option to cut and swap the halves of each alphabet prior to moving that letter as in Chaocipher, or not do it:
Plaintext letter moved, located at position (0 to 25, default 2, no move if > 25): moved to position (0 to 25, default 13): Cut Don't cut
Ciphertext letter moved, located at position (0 to 25, default 1, no move if > 25): moved to position (0 to 25, default 13): Cut Don't cut
Finally, since the processes for encryption and decryption are slightly different, we need to tell the program what we want to do:
Encrypt Decrypt
If we are decrypting, the ciphertext is descrambled using the Transposition alphabet as key. This is the result (no change when encrypting):
It is hard to show how the plaintext and ciphertext alphabets change after every letter encrypted or decrypted, so we'll only show the ciphertext obtained. Do the following to encrypt each plaintext letter:
The instructions for decryption are the same, except that you look up the ciphertext letter on the ciphertext alphabet (bottom), in order to obtain the corresponding plaintext letter. Then the alphabets are shuffled after each letter is decrypted exactly as described above. Here's the result of the operation:
When encrypting, we do a transposition as final step, using the Transposition alphabet as key. We begin with the result of the previous operation, which will be repeated if we are decrypting instead (transposition was done earlier). The ciphertext (plaintext when decrypting) is the first box below. The lower box contains the same, but split into codegroups of five characters each. We also perform some statistical tests, which are displayed before the last box.