The Nihilist Cipher creates a polybius square for a given key, and then an additional key to create the cipher text.
Nihilist cipher |
Example
This example is taken from Wikipedia. First we take our key (ZEBRAS) and create a Polybius square:
1 2 3 4 5 1 Z E B R A 2 S C D F G 3 H I K L M 4 N O P Q T 5 U V W X Y
Next we take our plaintext of "DYNAMITE WINTER PALACE" (Plain Text - PT) and an additional key of "RUSSIAN". We then add the mappings from the square to give the cipher text (CT):
PT: 23 55 41 15 35 32 45 12 53 32 41 45 12 14 43 15 34 15 22 12 KEY: 14 51 21 21 32 15 41 14 51 21 21 32 15 41 14 51 21 21 32 15 CT: 37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27
The cipher is then 37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27
Example
With a key of "HELLO", a message of "WELCOME", with an additional key of "TEST":
1 2 3 4 5 1 H E L O A 2 B C D F G 3 I K M N P 4 Q R S T U 5 V W X Y Z
First we convert the message:
PT: W E L C O M E 52 12 13 22 14 33 12
And then the additional key:
Add Key: T E S T 44 12 43 44
Add: PT and Key
52 12 13 22 14 33 12 44 12 43 44 44 12 43 --------------------- 96 24 56 66 58 45 55
The cipher text is 96245666584555