Learn What is Cryptography

0 comments


Cryptography has been around almost as long as language. People have been communicating for thousands of years and have been trying to keep information secret for just as long. Many cryptography methods have been in use for years, and still hold precedence today while leaps in technology have brought forth new methods. My hope is to instill a basic understanding of cryptography and to help people interested in the subject establish a base to witch they can move forward from.


For starters, there are some basic terms that are universal to anything related to cryptography and should thus be memorized.

Plain-text is a unencrypted message,
[ My name is Bob]

Cypher text is plaintext after it has been encrypted,
[ yM eman si boB]

A Key is what the receiver of the message uses to decrypt the message

While its obvious what I've done to the sentence, the difference is clear. One is readable while the other appears to be garble.

Plain and cypher text are universal when it comes to encryption, and are the basis for a encrypted message. One must become the other and then reversed to read the message.

Now on to cyphers; Cyphers can be divided into two main categories, with many sub categories within. The main two are Traditional and Modern cyphers. Traditional cyphers are basic, and have been around for a long time, while modern cyphers utilize the advancements in technology, mainly computers, making them much more advanced.

Traditional cyphers come in two main flavors: Substitution and Transposition. Both involve taking plaintext and mixing it up to create cypher-text. A very basic example would be pig latin. you are taking a message and saying it backwards, ie the example i gave earlier.
With Substitution, you take plaintext, and substitute characters within the message for others, thus scrambling it. Only the person receiving the message has the key and can unencrypted it. Substitution is specific in that when you scramble the message your moving individual characters around, or changing them out for new characters. With transposition your utilizing the same methods as with substitution but your scrambling sections of the message, instead of individual characters. The block of plaintext could be any where from a couple characters long to several sentences or more. Both still utilize the same method for the overall encryption and thus have the same weakness.

Frequency Analysis

Lets say for a moment that you receive an assignment to decode some cypher-text. You start looking at the message, and as notice that some characters appear more often then others. Frequency analysis, basically the use of statistics, involves taking these re-occurring characters and assigning new characters to them based on statistical data.

Lets take the word Experience. I'll encrypt the word and now we have GZRGTKGPEG. If we look at the word it becomes obvious once broken down that the letter g occurs the most out of the other characters with a total use of 4 times. Using statistics, if G is the most common occurring letter in the word, then we could associate this with E and substitute them.

EXRETKEPEE

Now looking at the alphabet you will see that G is two places to the right of E. We'll move the rest of the letters two characters back to get the original word Experience. This is Frequency Analysis in a nut shell. Using modern computer programs this basic technique can be applied to large quantities of cypher text, or can be used to create complex encryptions by layering the movement of characters of blocks of characters. While these can become incredibly complex they can still all be broken the same way given enough time and resources.

While Traditional cyphers can be very complex the weaknesses in there use led to the creation of Modern cyphers witch we will now take a look at.

Modern cyphers can be broken down into two main sub categories as well as several other types not related to the basic system used by the main two.
These two typed are Private Key (symmetric key) and Public Key (asymmetric key) encryptions. Well go through them in this order.

Private Key is simply a password system that keeps the key secret. The same key can be used to encrypt and decrypt, and is less complex then a public key system.
If Bob encrypts a message with Key A and sends it to Tom, Tom will use his copy of key A to decrypt it. The key must be secret to maintain the security of the cypher.

Public Key (asymmetric key) is a system that used a public key in conjunction with private keys. It utilizes a different key to encrypt and decrypt. Bobs company makes a key for encrypting messages that is commonly used, but when Bob sends the message to Tom, Tom uses his private key to decrypt it. If one key is compromised, the other part remains secret, thus maintaining security. This system can become very complex.

Since we covered the basics for Encryption, ill now talk a little about some basic methods for cracking cyphers, such as the ones above.

We already covered Statistical Analysis earlier but it is far from the only way to crack cypher text. Another common method involves Brute Forcing. This involves using a program to make repeated attempts to crack a cypher until it succeeds. This however takes time.

An exercise. is a scenario involving a simple cypher. Bob has a message for Tom. He used key A to encrypt it. Tom has key A as well making this a private key. The cypher-text looks like this:

7 14 7 18 10 3 16 22 21 7 3 22 7 24 7 20 1 22 11 15 7 22 10 7 1 9 7 22 10 11 9 10
The key: 1 = A

Its pretty simple from this point, as obviously you'll notice that every number represents the spot of a letter in the 26 letter alphabet.
Decrypted it looks like this:

GNGRJCPVU GCV GXGTA VKOG VJGA IGV JKIJ

Still looks like garble, but if we use statistical analysis we can crack the cypher text and get Bobs important message.
A quick google search will reviel that the most common letter in the english languadge is E . A quick look at the cypher text will show that G is the most common occurring letter in the sentence. Thus we'll start by swamping G for E:

ENERJCPVU ECV EXETA VKOE VJEA IEV JKIJ

Still garble but were moving in the right direction. Once agin a google search will show that the next most common letter statistical is T.
After scanning our cypher-text we see that V is the second most common letter there so once agin we start swapping:

ENERJCPTU ECT EXETA TKOE TJEA IET JKIJ

The pattern witch you might have already guessed is each character moved 2 spaces to the right. A becomes C, etc.... With that knowledge we can now finish the decoding process.

ELEPHANTS EAT EVERY TIME THEY GET HIGH

Now our cypher-text has been decrypted into readable plaintext and Bobs message to Tom becomes understandable. Not sure of the meaning tho, maby Bob was on something at the time but that aside, this shows how to types of encryptions can be used in conjunction. While this was a very simple cypher, something much more complex can be constructed using the same means, and that same cypher can be broken using Frequency Analysis, and by looking for patters. While everything taught here is at a very basic level it can be taken to great complexities when dealing with real world use.

I hope this has taught you something of the basics of cryptography. Once i get the time i plan on making more of these, with the next one dealing with a common but more complex cypher common to computer use. This is of course the Hash Algorithm.

Comments

0 comments to "Learn What is Cryptography "

Post a Comment

Related Posts Plugin for WordPress, Blogger...
 

Copyright @ 2013 All Rights Reserved.