A Ribbon, A Cipher Message and a Cylinder — Scytale

I love ciphers, and the Scytale cipher is one of the oldest around. In ancient times, ciphers were often using in love and war, and where…

https://upload.wikimedia.org/wikipedia/commons/5/51/Skytale.png

A Ribbon, A Cipher Message and a Cylinder — Scytale

I love ciphers, and the Scytale cipher is one of the oldest around. In ancient times, ciphers were often used in love and war, and where two people could pass a secret message without others knowing its contents. Mary Queen of Scots, for example, used a number of ciphers to communicate with her trusted entities:

But one of the oldest ciphers is the Scytale cipher. It was used by the Greeks within their military operations, and where they would create a cylinder of a given radius, and wrap a ribbon around it. Then, only the person with a cylinder of the right radius would be able to read the ciphered message. While it might not seem secure in our modern world, this secret message, at the time, was fairly secure (until the enemy knew the secret behind the cipher, of course).

Discover and review best Crypto softwares

In the following, we define a cylinder with 10 characters — defined as the height:

https://crypto.interactive-maths.com/simple-transposition-ciphers.html

If we take the word “letthebattlebeginwhenthesunhasrisenintheeast” and we write a message across the cylinder, and then down, we should get [here]:

llnreeetiatbhssteeethgsn eiui bnnn awht thah tese

If we wrap, we get every 10th character:

LetthebattLebeginwheNthesunhasRisenintheEast

and so on. In this way, we could produce a cylinder with 10 segments, and then take our cipher message, and wrap a ribbon around the cylinder, and write our message across from left to right, and then onto the next line. Next we unwind the ribbon, and can pass onto our troops. They just take their cylinder, and wrap the cipher ribbon around it, and can read the message.

So let’s code this in Rust. First we create the Rust project with:

cargo new scy

We then go into the rail folder, and add the following to the cargo.toml file:

[package]
name = "rail"
version = "0.1.0"
authors = ["billatnapier"]
[dependencies]
cipher-crypt = "0.18.0"

Next we go into the src folder, and edit the main.rs file with [here]:

extern crate cipher_crypt;
use cipher_crypt::{Cipher, Scytale};
use std::env;
fn main(){
	let mut m  = String::from("Attack at dawn");
let mut height = 3;
	let args: Vec   = env::args().collect();
	if args.len() >1 { m =  args[1].clone();}
if args.len()> 2 { height = args[2].clone().parse::().unwrap(); }

	let cy = Scytale::new(height);
	println!("\nMessage:\t\t{}",m);
println!("\nHeight:\t\t\t{}\n",height);
	println!("Scytale encrypt:\t{}",cy.encrypt(m.as_str()).unwrap());
	println!("Scytale decrypt:\t{}",cy.decrypt(m.as_str()).unwrap());

}

Finally we simply build with:

cargo build

For scytale encryption of the message “Hello” and a height of 3, we get:

cargo run "Hello" 3

A sample run is [here]:

Message:  letthebattlebeginwhenthesunhasrisenintheeast
Height:  10
Scytale encrypt: llnreeetiatbhssteeethgsn eiui bnnn awht thah tese
Scytale decrypt: lelinurie ebentnina tabwhhsts tteheaeht htgessne

So, if you want to try this for yourself, here’s a Syctale cipher generator:

Conclusions

Go on, make your own Scytale cipher, and go and show your kids, and get them in the wonderful world of ciphers. If you want more cipher puzzles, try these:

https://asecuritysite.com/encryption/ctf

Get Best Software Deals Directly In Your Inbox