Today’s blog is a bit different, I'm sharing with you an interest I have in cryptography and a cipher I had written myself. I hope you enjoy it and can understand it!
When I mention cryptography today, what do you think of? Public key encryption with 1024 bit key strength? Supercomputers, mind melting mathematics and computer programming? This is what I thought of and at first it put me off even though I was interested in this fascinating subject! The level that today’s cryptography has reached seemed unreachable and un-achievable to me, but then I realized I was looking at the wrong end, I needed to look at the beginnings of cryptography, at how it first came about and changed over the years as people constantly evolved it to withstand the attacks by people who sought to break them!
Hand written cryptography may seem obsolete today, there are many products on the market that provide a service to secure information, but where is the fun in the using someone else's product/solution? I have read books on the subject but I would never claim to be an expert. I have had a lot of fun in the creation of my own code. I believe it is strong but I would never in a million years say it was un-crackable. The very fact that you have written your own code in it self adds strength to it as it is an unknown quantity to any attacker. So why am I writing this? Should I not keep my code secret, locked away and jealously guarded? No. The strength is not in how the plain text is converted into cipher text but in the key used. If the attacker does not possess the key it does not aid him knowing how the cipher works. It does allow for a brute force attack but now we are straying out of the realm of hand written ciphers into the world of computer programs written specificity to break a given cipher. The key I use is 148 characters long, I'm no good at mathematics, perhaps someone reading this and interested enough could tell us how long/hard that would be to brute force? My thoughts on the matter is good luck! I am not sending or storing state secrets, I just want to protect my private thoughts or messages to loved ones via public forms of communication. I am assuming that the difficulty to crack the code plus the fact the information is of little interest will put off most attackers.
By public forms of communication I mean, emails, texts, documents stored in 'the cloud' and posts online in public forums like face book. Most of these you might think are private because they are sent directly from the sender to a recipient or stored in a private space online that only you have access to. It has been proved time and again that these are not secure and people can and will gain access. Governments, the press and hackers to name three groups of talented people who have a vested interest in your information.
My code uses a table that in the center of it is a square 37 x 37 characters. These characters are the plain text characters used to write the plain text. For this example of my code I will just use the letters of the alphabet which will give me a grid of 26 x 26.
On each face of the grid are the characters of the cipher text. These can be anything you want but to make it easy I will just use the alphabet in a randomized form. You will have four randomized alphabets one on each face of the grid and this is our key also.
Below is an example of the table. In red is the characters used as the cipher text and in blue are the plain text characters. In-between in yellow are numbers running in sequential order from 1 too 104 around the blue square, these are the character numbers. Take the word 'revenge' there are seven characters in the word, R is number one and the finale E is number 7. To encrypt this word using the below table we take the letter R go to column 1, we move down the column until we reach the letter R and then follow the row across to the right until we meet the cipher text letter in red which is O. The second character is E, we move too column 2 and follow it down to the letter E and then along the row to the right until we reach the cipher text letter in red which is X. Repeat this until the process is complete and 'Revenge' becomes 'oxelogh' To reverse the process take O we know it's the 1st character, so we find the letter O in the red column on the right hand side of the table and follow the row to the left until we reach column 1 and we have the letter R.
When we reach character 27 you will notice that it has moved round onto a different face of the blue square. We can ether rotate the table anti clockwise and continue or keep it the same way but now you follow row 27 across to the left until you reach the plain text letter then follow the row down until you reach the cipher text letter in red. From 53 to 78 you follow the row up and then to the left and from 79 to 104 you follow the row to the right and then up. When you get back to position one again you have completed a block of 104 cipher text characters and the sequence starts again at position 1.
In the hand written form this cipher is only really good for short messages/texts/posts I hope to learn to program to automate the process. I did find a kind person who did this for me but it was saved on a floppy disk and has been lost. It was nice and simple, a box to enter the key, a plain text box and a cipher text box.
This is what a short passage looks like
ukht fe bsln h vunxk xohgynm kfdzt lghy
Take out the spaces
you'll notice that the double letters in the words used are not replicated in the cipher text. This example uses a basic table the full one I use, uses spaces and numbers as well. The blue square in the center also does not need to be laid out in order as I has shown here it can also be randomized.
The process is a bit laborious and if your not concentrating it is easy to lose your place. I will eventually learn to program in order the make the process fast and error free.