DIY Cryptography with Perl 6

Perl 6 → Raku This article has been moved from «perl6.eu» and updated to reflect the language rename in 2019.

[8] Part 1-4 published 21. April 2019. Part 5 published 26. May 2019

This article is not about using existing cryptography methods in Raku, but presents a home made algorithm by yours truly.

To quote Loup Vaillant: «Rolling Your Own Crypto: The standard advice is "don't". You think you know what you're doing? You don't. You think your crypto is secure? It's broken. Just give up. You are not smart enough, you are not wise enough. Those who invented secure crypto just aren't human.»

I'll have a go at it anyway. Sit back, and enjoy the show as I shoot myself in the foot. Or the feet.

This article is quite large, and come in four parts:

• [8.1] Part 1: Base 36

• [8.2] Part 2: Base 400

• [8.3] Part 3: Changing Keys

• [8.4] Part 4: Postscript



And a fifth part, added 26. May 2019:

• [14] Part 5: Real Text

The programs presented in part 2, 3 & 4 must be run from the current directory, as they rely on the module directory «lib» being there.

Do not use any of these programs (or algorithms) to encrypt important information.

The programs shown is this article are modified as we go along. The version present in the zip file is the final one.

Further Reading

• A beginners guide to codebreaking by Prof. Graham A. Niblo (PDF)

• The Code Book by Simon Singh (Book)