Sunday 10 January 2010

A new hobby

Why is that going on holiday has made me more productive? Maybe I am actually solar-powered.  Anyway, I've managed to get interested in the fields of cryptography and cryptanalysis.  Obviously, I can't make much progress in learning about this field, but I've already got several books on order from Amazon, for when I return.

I have, however, managed to make some progress, having written a program to break any shift cipher like ROT13, or the Caesar cipher.  Such ciphers work by moving the encoding alphabet along and wrapping round the missing characters; so the ROT13 cipher looks like this:

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
N O P Q R S T U V W X Y Z A B C D E F G H I J K L M

 So the message "Hello, World!" becomes: "Uryyb, Jbeyq!".  Decryption is done by performing the reverse. The small number of possible shift cipher's means that the decrypting can be done by brute force alone, and this is exactly what the program I'm writing does.  The difference is that after that the program uses a dictionary of words to find the decryption attempt with the most words which are actually valid.  This means that the system will be able to operate automatically.  I'll put the code up when the program is completed.

No comments:

Post a Comment