For The Love of Ciphers: Fractionating and Transposition Ciphers - The Delastelle Cipher
Didn't you just love sending secret messages as a child ... if not perhaps don't read on? If so, let's look at an interesting cipher created by Felix Delastelle.
In Morse Code we have the problem of coding with varying lengths of encoded characters (the dots and dashes), where we must put a space (or pause) in-between. To overcome this we can use a fractionating cipher, where we convert our encoded characters into three character sequences. For example "Hello World" in Morse Code becomes:
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
H E L L O SPACE W O R L D
We can then make this into a string with an 'x' between characters:
Plain text: H e l l o w o r l d Morse string: ....x.x.-..x.-..x---xx.--x---x.-.x.-..x-..
We can now use three-character mappings to convert them back to text:
['...', '..-', '..x', '.-.', '.--', '.-x', '.x.', '.x-', '.xx', '-..', '-.-', '-.x', '--.', '---', '--x', '-x.', '-x-','-xx', 'x..', 'x.-', 'x.x', 'x-.', 'x--', 'x-x', 'xx.', 'xx-']
This mapping is:
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 . . . . . . . . . - - - - - - - - - x x x x x x x x . . . - - - x x x . . . - - - x x x . . . - - - x x . - x . - x . - x . - x . - x . - x . - x . - x . -
which will map to "ABCDEF...Z". Next we can convert them back with:
AGTCDHOTQODTCJ
For "Peter piper picked " we get:
.--.x.x-x.x.-.xx.--.x..x.--.x.x.-.xx.--.x..x-.-.x-.-x.x-..xx
P e t e r ' ' p i p e r' ' p i c k e d ' '
If you are interested, here are the Morse Code mappings;
E . S ... H .... B -... 1 .---- period .-.-.-
T - U ..- V ...- X-..- 2 ..--- comma --..--
I .. R .-. F ..-. C-.-. 3 ...-- query .-.-.-
A .- W .-- L .-.. Y --.- 4 ....- colon ---...
N -. D -.. P .--. Z --.. 5 ..... s/colon -.-.-.
M -- K -.- J .--- Q --.- 6 -.... dash -....-
G --. 7 --... slash -..-.
O --- 8 ---.. equals -...-
9 ----.
0 -----
Felix Delastelle, in 1895, saw the potential of this method and then used it to create a bifid cipher which uses fractionation and transposition, and where we take a key and then translate it into three squares.
An example key is:
EPSDUCVWYM.ZLKXNBTFGORIJHAQ
We then make three squares from this:
square 1 square 2 square 3 1 2 3 1 2 3 1 2 3 1 E P S 1 M . Z 1 F G O 2 D U C 2 L K X 2 R I J 3 V W Y 3 N B T 3 H A Q
If we take a plain text message of "THIS IS A TEST", we locate the text in the squares defined above:
THIS IS A TEST
--------------
T - 233
H - 331
I - 322
S - 113
I - 322
S - 113
A - 332
T - 233
E - 111
S - 113
T - 233
Next we would order as:
THISISATEST
-----------
23333132211
33221133322
33111113233
And we would read the code in a horizontal way to give:
233 333 321 321 311 111 331 233 232 123 123
And then substitute back the letters on the grid:
233 333 321 321 311 111 331 233 232 123 123 T Q R R F E H T B C C
If you understand this, why not try your skills here?
And if you really want a challenge, try to crack the following fractionated ciphers here.
Associate Director, Kyndryl UK & I, Security and Resilience Consultant
7 年Dah-de- Dah