Thursday 2 July 2009

Random permutation encryption

Years ago I dabbled in writing some cipher programs. Very basic stuff, really, but one came back up in my mind just this morning. The method of encryption was to pseudo-randomly rearrange the letters in a message according to a particular random seed. Without knowing that seed, I supposed, it would be impossible to restore the original message.

The problems were two-fold. First, the random seed I chose to use was the length of the original text, which would be easy to discover and also meant that all messages of the same length would be rearranged in similar ways. The second problem is that all the letters of the original message are right there in plain view, so a common anagram solver could reassemble the message with a little human help.

The solution to the seed problem is to use a shared secret seed between the sender and receiver of the message - one that is not dependent on the length of the text. The second problem can be solved by adding gibberish to the end of the message, which would then be mixed into the rest when it is encrypted. An anagram solver can still find the original message, but it will also (hopefully) find dozens of nonsense messages that are difficult to tell from the real thing.

Mokalus of Borg

PS - There are still problems, of course.
PPS - And if you need something properly encrypted, this is definitely not the way.

2 comments:

Erin Marie said...

Your smartness makes my brain hurt.

John said...

Sorry about that. :P