Monday, May 6, 2013

InfoSec: The Caesar Shift Cipher





I will come right out and say as a disclaimer that I am not a code breaker, or cryptography specialist, Nor do I have any solid hands on experience in Information Security so this is purely academic. But like a diligent professional I strive to learn the ins and outs of whatever comes my way in the event it helps me out some time down the road. 

The Caesar Shift is believed to be the first example of a substitution cipher used for political and military purposes. Gaius Julius Caesar used this cipher to encode all of his private correspondence to friends and colleagues in Rome while he was commanding the 13th Gemina Legion in Gaul. The code involved a simple shift of alphabetical order known as an algorithm. So if we use a four letter shift then we jump four letters in the alphabet and the fifth letter will become the code. For example if the letter A is to be encrypted and the shift used is four letters then A will appear encrypted as E M as Q and so on and so on. 

The Caesar shift cipher therefore has 25 different potential ciphers and in turn 25 separate keys depending on which shift is chosen. However this makes it very insecure to people experienced with ode breaking because if the analyst suspects a Caesar shift has been used they only have to check 25 potential keys in order to decipher.

This is not to say it is not a useful tool and understanding a simple cipher can go a long way towards learning more advance codes. So if we were to send the message

REINFORCEMENTS ON THE WAY

And we wanted to encode the message using a four point cipher the message would be translated into

VIMRJSVGIQIRXW SR XLI AEC

Now while this is not the most complex of codes it is a tool that is available and there are methods to make a cipher  even more secure by using additional techniques like removing spaces or punctuation marks, including symbols and numbers into your master code, There are lots of ways to enhance a simple cipher. Many historical ciphers that involved monoalphabetic substitution keys would sometimes use symbols to replace certain letters of the alphabet which would have the effect of making the encrypted message seem even more confusing to anybody other than your intended audience.

The same cipher can be used with numbers if we were to build a legend to encode our above message with numbers it would look like this.

R E I N F O R C E M E N T S O N T H E W A Y
18-5-9-14-6-15-18-3-13-5-14-20-19 15-14 20-8-5 23-1-25

So the use of numbers is also a possibility to deliver coded messages by using the exact same system with only a minor change. You could also just use any combination of 26 numbers, Letters, Symbols etc so long as the key to the cipher is either made available somehow to the receiver or some hint is provided to them to discover the key then the message is easily decrypted.

I am hoping to write more articles on codes, ciphers and symbols in the coming months. It is really a fascinating subject of human history.

Greyman

No comments:

Post a Comment