Carla Moretti
- Home
- /
- Guides
- /
- Intermediate
- /
- What is Cryptography and...
What is Cryptography and How does It Work?
Carla Moretti
What is Cryptography?
The art of Cryptography is as old as time itself. In the simplest terms, cryptography is the technique of using a code to hide information, such that only the intended recipients of the information will understand the message.
The scientific study of cryptographic algorithms and cryptology only started about 100 years ago, and with the advent of computers and complex machines, the focus of science has mostly been in the realm of computers. In computer science, cryptography deals with information-sharing techniques that are highly secure, and derive their security from mathematical principles and computer algorithms.
Before we go into the depths of what is Cryptography, let’s take a brief look at where the idea stems from.
History of Cryptography
The first instances of Cryptography can be found as far back as 1900 BC in a Nobleman’s tomb in Egypt. Instead of the usual inscriptions, the walls of the room used text that used stylized symbols that were not found in other tombs. Although the purpose was probably not providing a hidden message, it was still the first instance of a language being manipulated by using a different script to represent something different.
A true display of cryptography can be found in Ancient India, where spy networks used coded messages to give assignments to spies. The mentions of this network are found in Arthashastra, a book on statecraft written by Kautilya, a prominent writer of his time. However, the first proof of what is known to be a ‘cipher’ are found in Julius Caesar’s time. A cipher is encryption, in which you require the key to unlock the meaning of the message. This cipher, known as the Caesar Cipher, is the oldest known cipher.
In 100 BC, the Caesar Cipher was used to communicate with the generals on the frontlines. Since the distance was great, there was a great chance that messages would be intercepted. Thus, a very simple system was designed. Every letter was shifted by three letters, so now a D would be an A, and an E would be a B, and so on. Since the cipher itself was simple, it was highly dependent on the system remaining secret to not get cracked.
Vigenere's Secret Key
The first cipher with an actual encryption key was designed by Vigenere in the 16th century. The secret key was reiterated throughout the message, and using the key character modulo 26, the resulting ciphertext was produced. Although the execution was pretty shoddy, it was still the first time someone had introduced the concept of encryption keys to ciphers. Unlike previous systems, the system’s secrecy was of a lesser importance than the secrecy of the encryption key.
Hebern's Private key
The 19th century came, and with it came electricity. Hebern designed a half-electrical, half-mechanical machine which he dubbed as the Hebern rotor machine. It used a single rotor, with the secret key hidden in the rotating disc. The disc had the substitution cipher so that whenever someone was typed out, the characters were replaced with the cipher text. Again, the system was quite simple and could be broken by using letter frequencies. Letter frequencies are the average times a letter appears in words in a language.
The Enigma
This is where things start getting interesting. If you’ve watched Benedict Cumberbatch’s “The Imitation Game”, you know where this is going. The Germans invented the machine called the Enigma machine nearing the end of World War I. They put it into use in World War II, and the machine was a huge success. It used 3-4 rotors, each rotating at a different speed. It took quite some time for the rest of the world to catch up and break the code. Although the code was first broken in Poland, the British mathematician, Alan Turing, received a lot of acclaim for finding a more efficient method of breaking the code, essentially saving the World War II effort and eventually bringing about Germany’s defeat.
The Modern World and Cryptography
In modern terms, what is cryptography? In the 1970s as the popularity of computers rose, big chunks of data started becoming digitized. IBM saw that there was a need for encryption methods to protect data. Therefore, the company started a group that produced a cipher called Lucifer. The cipher was adopted by the Nation Bureau of Standards in 1973 and renamed to Data Encryption Standard. The DES survived for quite some time but was eventually broken in 1997 when computational power increased, and hackers could use a simple brute-force attack to destroy systems. NIST again started its search for a stronger encryption algorithm, and it finally found Rijndael. It was renamed Advanced Encryption Standard or AES.
Historically, whenever systems were relied upon and not the secret key, the systems were broken quite easily. Furthermore, once the secrecy of a system is compromised, every message that was sent using that system is automatically compromised. When a key is compromised, only certain messages are compromised. This is why the system’s secrecy should hold little to no importance compared to the encryption key’s importance, according to Kirchoff’s rule.
Objectives of Modern Cryptography
There are certain objectives that modern cryptographic algorithms try to achieve. Firstly, the message must be encrypted in a certain way, such that it is completely confidential and can only be understood by the intended recipients. The integrity of the data should also be maintained, i.e. it cannot be changed during transit or storage. There should also be ways that hold the sender/owner of the data accountable, such that they cannot deny that they propagated that information. Finally, there should be methods in place to allow senders and receivers to authenticate each other’s identities.
Classifications of Cryptography
Single-key/Symmetric-key encryption
Single-key or symmetric encryption involves fixed lengths of bits often referred to as block ciphers. A block cipher is a technique of encrypting data in blocks to produce ciphertext. There is a secret encryption key that the receiver can use to decrypt the message. The most famous example of single-key encryption is the Advanced Encryption Standard (AES). As previously mentioned, AES was approved by the National Institute of Standards and Technology (NIST) as a Federal Information Processing Standard (FIPS 197) to protect private information. AES is free, and is implemented in various solutions worldwide.
It is quite similar to its successor, DES, except that it uses longer key lengths in the form of 128-bit, 192-bit, and 256-bit to beat the DES’s weakness to brute force attacks. Symmetric key cryptography is popular in various domains. Let’s take another example of single key algorithms.
International Data Encryption Algorithm (IDEA)
The International Data Encryption Algorithm (IDEA) was the brainchild of researchers at ETH, a research university in Zurich, Switzerland. The IDEA cipher bases its security on the assumption that the secrecy of the algorithm is not important, but the secrecy of the cryptographic algorithm key is. It uses a 128-bit key in a 64-bit block. It converts a 64-bit block of plaintext to ciphertext, dividing the input plaintext block into four subblocks of 16 bits.
There is a series of eight transformations, with each transmission known as a round, which ends with an output transformation known as the half-round. A block cipher is created with round blocks possessing a round key. The mathematical operations used are modular addition, modular multiplication, and bitwise exclusive-OR (XOR).
IDEA has low hardware requirements and is easy to implement with quick execution. It is used in financial services, audio and video cable for TV, and smart cards, amongst other applications.
Public/Asymmetric-key Encryption
Public or asymmetric cryptography encryption algorithms use pairs of keys. The public key is known by everyone and is used for encrypting the message. The private key is only known by the person who encrypted the message, and only they decide who they want to share it with. Public encryption is very popular and used in various cryptographic algorithms. The public key and private key cannot be the same.
Rivest-Shamir-Adleman (RSA) Algorithm
RSA was published in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman of the Massachusetts Institute of Technology by using the public key algorithm by the mathematician Clifford Cocks, a great example of public key cryptography and asymmetric cryptography. When RSA is used, both the public and private keys can be used to encrypt a message, but the opposite key is always used to decrypt the message. For example, if the public key is used to encrypt the message, the corresponding private key will be used to decrypt it.
This can only be done by the private key and public key not being the same key, something which RSA achieves. RSA is very popular and is used in various implementations on the internet, including Secure Shell (SSH), OpenPGP, SSL/TLS, and S/MIME. They use RSA for digital signatures and encryption. The most prominent example is browsers, which need a digital signature to form secure connections. The RSA signature is the most common encryption technique on the internet.
RSA is popular because of its great security. The way the algorithm works is, it uses two large prime numbers and produces an end number. It is virtually impossible to find the numbers that were used to produce the number since the computational power required to do that would be very high. The prime numbers are generated through the Rabin-Miller primality test algorithm. The modulus is calculated by multiplying the prime numbers and is the link between the public and private keys. The modulus of both the private and public key is calculated using the Extended Euclidean Algorithm.
Elliptic Curve Digital Signature Algorithm (ECDSA)
The elliptic curve digital signature algorithm (ECDSA) has been most popularly used by Bitcoin. It uses some highly complex mathematics, combining ideas from finite fields and elliptic curves to create one-way equations. This means that you can choose a random private key and then use it to calculate your public key. However, it doesn’t go the other way around i.e., you cannot calculate the private key using the public key. It is so difficult that it would take trillions of computers and trillions of years to guess the right private key for a certain public key! The ECDSA is another great example of a public key cryptography technique used in modern technology.
Digital Signature Algorithm (DSA)
The Digital Signature Algorithm (DSA) is used for digital signatures and their verification. This public key cryptography technique uses modular exponentiation and discrete logarithm. The process starts with the generation of the key. It is then distributed and signed, and finally, the signature is verified. The purposes it is used for are similar to the purposes that RSA is used for. However, it differs in some key aspects. Firstly, it is a dedicated digital signature algorithm, whereas RSA is a cryptosystem algorithm. It uses modular exponentiation and discrete logarithm instead of RSA’s factorization of primes. It’s also faster in key generation, but slower when it comes to encryption. It beats RSA in decryption speed and is best used for signing in and decryption, whereas RSA is best used for verification and encryption.
Diffie-Hellman Key Exchange
The Diffie-Hellman key exchange method is quite unique, as it is a method of digital encryption that involves the exchange of cryptographic keys over a public channel, without their conversation being transmitted to the broader internet. The key raises numbers to a randomized power to produce decryption keys. The parties involved create a key together without any communication, and yet the key is mathematically near impossible to break. The Diffie-Hellman key is used for encryption, password-authenticated key agreement, which prevents man-in-the-middle attacks, and forward security, which generates new keys for each session to ensure that they do not get leaked.
Final thoughts
Amongst the various cryptographic techniques mentioned, which one do you think holds the best in current times? Do you use a crypto wallet or what measures do you take to keep your cryptocurrency safe?
Skrumble.com provides all its content for informational purposes only, and this should not be taken as financial advice to buy, trade, or sell any investment instruments or products, including but not limited to cryptocurrencies, or use any specific exchange. Please do not use this website as investment advice, financial advice, or legal advice, and each individual’s needs may vary from that of the author. Investing in financial instruments, including cryptocurrencies, carries a high risk and is not suitable for all investors. It is possible to lose the entire initial investment, so do not invest what you cannot afford to lose. We strongly advise conducting your own research before making any investment decisions. This post includes affiliate links with our partners who may compensate us.
To view our privacy policy read here.