Cryptography Crash Course: Cyphers

Cryptography 101: Cyphers

Logan Robinson
Possibly the The most basic form of cryptography are cyphers. Cyphers are a set of rules that are followed to encrypt and decrypt a certain message. The easiest way to do this is a simple one-to-one correspondence between the letters of an alphabet and another set of symbols with the same number of ‘letters’. In the case that each letter is simply shifted down the alphabet a given amount – A→C, B→D, C→E – you have the Caesar Cipher. Now, ‘E’ appears most commonly in English sentences – vastly more often than others, with ‘T’ coming in closest by 3.646% (Figure to left). It therefore makes sense that if you could find the most common letter in a large enough block of text that was encrypted this way that you would just find the amount that that letter is shifted over from ‘E’. For example, suppose we move each letter down the alphabet. “CRYPTOCOM IS WICKED DOPE” becomes “HWDUYTHTR NX BNHPJI ITUJ”. Seeing that ‘J’ appears in the places that ‘E’ does in the non-encrypted phrase and that ‘J’ is five spaces away from ‘E’, we can see that the second text is the first with all its letters shifted forward by five. Unfortunately, this phrase is not large enough to find the most common instance of a letter, however, that method could be applied to a whole book ciphered this way. For you mathematics savvy folks: E(L)=(L+n) mod 26 to encrypt and D(L)=(L-n) mod 26 to decrypt. In this case n=5. With the power of computers now, it would be easiest simply to check all values for n=1through 26, however the method of testing for the most common letter in a language can be traced back around 1200 years to Al-Kindi.

Cypher letter

For any finite sequence of symbols, there are countless conjectures that can be made to describe it – But very few that can make accurate predictions about subsequent symbols. The Chinese language has unique symbols for most words as well as letters, so an attempt to use the previously discussed method would be futile. Therefore, when you and a second party are trying to communicate using a code, a third party could break your code much more efficiently if they first knew what kind of system you were using.

This information was the Achilles heel of basic ciphers like the Caesar Cipher. With that knowledge, even brute force might break some polyalphabetic ciphers – that is, a cipher that changes alphabet used at every new symbol. The German enigma code was essentially an extremely complex polyalphabetic cipher that was broken by Alan Turing by a combination of operator carelessness by the Germans and brute force by Turing. Although the Germans’ code was broken, a minor variation on it called Fialka was used in the military until the 1970s.

A good code would be one in which even if a third party knew what system you were using could not break it.

You know how in grade school your math teacher taught that “guess and check” was a sin? Well it is. It’s horribly inefficient. But Cryptographers use that to their advantage. RSA encryption involves the following equation:

Nn mod P= C

With N being a primitive root of P a prime, and C being a number less than P. Example:

7n mod 29 = 6

Now solve for n. Just kidding. It might take a while. Mainly because the best tool at your disposal is “guess and check”. The way the two parties communicate has to do with both already having a unique power of N, but the point is that if you don’t have either power, you need to solve for n. Now suppose your prime is a hundred places long, solving for n could literally take longer than anyone has ever lived. Clearly, guess and check could never work and it makes no difference if someone else knows you are using RSA. RSA encryption is so common and requires so little computation from either communicating party that your web browser uses it, programs you pay for and install use it, and your bank uses it. So why doesn’t your audio jack? This is Voicelock.

Wanna learn more about our upcoming Voicelock product and be updated about our latest blog posts? Check out our facebook page and twitter!

Cryptography Crash Course: Cyphers