3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Vigenere cipher with rotating cleartext

Vigenere cipher with rotating cleartext
The Vigenere cipher was publicized by Lewis Caroll, who's best known for writing the Alice books and poetry. Essentially, the cipher is a complex shift code, based on a key word.

For a full explanation of the code, visit http://en.wikipedia.org/wiki/Vigenère_cipher

In this instructable, I'll lay out a method by which the cleartext (the initial message, before encryption) can be disguised to help prevent decryption using either of the methods, since even decrypted it would read as gobbledygook.

The concept of rotating cleartext I got from Dan Brown's book Digital Fortress.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Select cleartext

For the method I'll be using here, the cleartext should be a square number of letters. For example, one flew over the cuckoo's nest.

However, you could choose any cleartext you want, you can usually play with it to get a square number of letters.
« Previous StepDownload PDFView All StepsNext Step »
6 comments
Sep 3, 2010. 10:18 AMuthus says:
Jules Verne used something like this in "800 Leagues on the Amazon." He used a numeric key to shift everything. So using the key 1234567890 and the clear text "Once in a galaxy far far away," you'd get: ppfinthojlbzbjfxmiaaxcb. 0 can shift either 10 characters or 0. I use 0. The key repeats ad infinitum. I'd never thought of using random characters at prime positions.
Sep 3, 2010. 7:23 AMPKM says:

 

However, if you choose one that's too long relative to the cleartext, it can get dicey.


Is it?  From what I remember of my crypto course, for a Vigenere-style cipher you want the key to be as long as possible, preferably the same length as the cleartext with no repeating patterns.  The "secret weapon" against Vigenere ciphers (or more broadly, substitution ciphers) is frequency analysis, and if the key is only a few letters long you can quite easily do multiple periodic frequency analyses (every 6th letter with varying offsets from the beginning of the ciphertext) and deduce the key providing the message is long enough.

Ideally, I think, you want an aperiodic key that never repeats, at which point I think you have a one-time pad which is a slightly stronger class of encryption than Vigenere.  Can you tell me why an overly long key is a bad thing?
Sep 3, 2010. 8:18 AMPKM says:
Ah, very true- long keys present a problem if they aren't pre-shared. I noticed your suggestion to add random letters at irregular intervals but it took me a moment to twig that that will foil periodic frequency analysis. It's quite a nice solution, actually- mine to the same problem was to mess with the keytext using prime numbers, but I think I prefer yours.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
4
Followers
3
Author:mhippo