Monday 4 June 2018

The Mathematics and History behind Cryptography

You may have come across the word cryptography quite often. If you are wondering what it is, you might just find your answers over here.



What is Cryptography?


Cryptography is a technique to store and transmit data in a particular configuration, so that only those for whom it is intended can read and process it. We can also say that Cryptography is about communication in the presence of an adversary. You can use it to hide passwords, to hide emails, or to hide virtual money as crypto-currency. 



The Origin of Cryptography


Cryptography builds from the field of pure mathematics known as Number theory which deals with integers. Mathematics began playing a major role in cryptanalysis in 1932. This was just before the Second World War, when the Poles understood that in order to break the new German Enigma machine, which was one of the first machines to use electricity to encode a message; they needed the logic of mathematics to break that cipher. They hired 3 recent mathematics graduates, led by Marian Rejewski, which was the first time pure mathematics was used to break a cipher. They were successful, starting in December of 1932 until Poland was invaded by Germany in September of 1939. The Poles’ method of code breaking did not work after Germany made some operational changes. Alan Turing, with the help of Gordon Welchman, two British mathematicians, then built on the Poles success in designing the Bombe (an electro-mechanical device) to methodically break the Enigma code regardless of future German operational changes. This led the way to the computer revolution.



How does it work and why does it require Mathematics?


Most modern computer cryptography works by using the prime factors of large numbers. Prime numbers have a very special property for factorization. One of those properties is that while it is relatively easy to find larger prime numbers, it’s unavoidably hard to factor large numbers back into primes. It is quite easy to figure out that 10 is 2*5. A computer could factor out 9761 as 43*227 in a matter of seconds but it would take some more time to prime factorize a number fifty digits long. If you multiply two large prime numbers, you get a huge non-prime number with only two very large prime factors (100s of digit numbers). Factoring that number is a non-trivial operation, and this fact is the source of a lot of Cryptographic algorithms. Basically you have a "public key" consisting of a product of two large primes used to encrypt a message, and a "secret key" consisting of those two primes used to decrypt the message. You can make the public key public, and everyone can use it to encrypt messages to you, but only you know the prime factors and can decrypt the messages. Everyone else would have to factor the number, which takes too long to be practical, given the current state of the art of number theory. A modern super-computer could chew on a 256-bit factorization problem for longer than the current age of the universe, and still not get the answer.
It’s possible that new mathematical strategies or new hardware like quantum computers could lead to quicker prime factorization of large numbers, which would effectively break modern encryption, but Number theory would always play a big role in encryption.




The Mathematics and History behind Cryptography

You may have come across the word cryptography quite often. If you are wondering what it is, you might just find your answers over here. ...