The Fractional Cipher

Morse code has a bit of a problem, as we need to insert a small pause between the letters, and between the words. In its standard form it…

Photo by Alex Motoc on Unsplash

The Fractional Cipher

Morse code has a bit of a problem, as we need to insert a small pause between the letters, and between the words. In its standard form it is made up of dots and dashes:

Standard Morse code
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 -----

For example, “Hello World” is:

.... . .-.. .-.. --- /      .-- --- .-. .-.. -..
H E L L O SPACE W O R L D

With a fractional cipher, we can then make this into a string with an ‘x’ between characters. For “Peter Piper picked”, we get:

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 ' '

So let’s take an example of “Hello world”:

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 back to “ABCDEF…Z”. Next we can convert them back with:

AGTCDHOTQODTCJ

Here is an online calculator for this:

https://asecuritysite.com/encryption/frac

Now what is the food for the ciphertext of:

JGQDWQI

Don’t just go and Google a solution. Get a piece of paper and a pen, and work it out.

Go to Q29 for another challenge:

https://asecuritysite.com/encryption/ctf