What Are Encryption and Decryption?
When the subject of blockchain comes up, so do encryption and decryption. That’s not surprising since blockchain would not exist without these two processes.
Encryption, decryption, and cryptography come from the same Greek root word, “kryptos,” which means “hidden.” Using that definition, we can surmise what the English words mean.
When you encrypt a data or file, you convert it into a secret code that remains unusable unless decrypted. Information that needs to be encrypted includes newly discovered formulas, financial statements, unclassified military data, and a lot more. These kinds of data need protection because they are sensitive and contain information that other entities might take advantage of or abuse.
When you encrypt a piece of information, the computer will ask you to set up a password. Once this is done, no one can access or decipher that encoded information. Even if someone else opens it, they will only find a series of garbled code that doesn’t make sense.
Types and Process of Encryption
There are different types of encryption, which follow different processes. To understand how each of these processes works, we first have to look at the nature of each encryption type.
There are currently two main methods of encrypting data – symmetric and asymmetric encryption.
Symmetric encryption, which is also called shared secret encryption, is the oldest encryption method. The ancient Egyptians were the first group known to have used this method. Ancient Egyptian hieroglyphs are the oldest form of cryptography.
In this method, the person who creates the data uses a secret key to make it into gibberish. He then gives the same secret key to the receiver who, in turn, uses it to decipher the code. In the symmetric method, the sender can change the key and thereby change the results of the encryption.
Symmetric Encryption Process
Symmetric encryption has five components:
- Plaintext document – This is the original message that needs to be protected.
- Data encryption – The computer uses a complicated mathematical process to change the plaintext document into undecipherable codes and symbols using a secret key.
- Encrypted document – The encrypted document makes its way to the receiver.
- Data decryption – The receiver uses the secret key to decode the message.
- Plaintext document – Once decrypted, the document becomes plaintext and can be read again.
Although symmetric cryptography is the oldest and most common form of encryption, there’s one problem with this method. If someone other than the intended recipient acquires the secret key, they can easily access your document. Therefore, it is essential for the sender and receiver to create a secure way of transporting the secret key.
Asymmetric encryption, or public key encryption, uses two mathematically related keys to encrypt and decrypt data. It uses a trapdoor one-way function – a function that is easy to compute in one direction but difficult to do in reverse – to keep the encryption key secure.
The trapdoor one-way function makes a value easy to compute from given data but determining that data from the value is difficult. However, if you have an additional piece of secret information, you can easily compute the inverse function as well.
Here’s an example to demonstrate how it works: y = f(x), with fas the trapdoor, is easy to compute. However, if you invert that calculation into x=f-1(y), it is difficult to solve the problem. Hence, you need some secret information which, in this case, we will call k. Then the problem y=f-1(x,k) becomes much easier to solve.
This process means you can publish your public key, which is the result of a one-way function on your private key. Reversing the process to try and determine the private key is as tricky as the mathematical problem above.
Asymmetric Encryption/Decryption Process
As opposed to symmetric cryptography, asymmetric encryption uses two keys: one to encrypt and one to decrypt data.
– The encryption process starts with a mathematical formula that converts the plaintext into a pre-hash code.
– The sender uses his private key to encrypt the pre-hash code.
– The algorithm used by the software generates the private key.
– The encrypted pre-hash code and the file will undergo another encryption process using the sender’s private key.
– After that, the sender has to retrieve the public key of the file’s recipient.
– The sender uses the recipient’s public key to encrypt the message.
– When the recipient receives the file, he has to decrypt the message so he can read it.
– First, the receiver uses his private key to decode the message.
– After that, the receiver uses his private key to decrypt the encrypted pre-hash code and file.
– The receiver gets the sender’s public key to verify the identity of the sender and to decipher the pre-hash code.
– The receiver creates a post-hash code from the file. If this post-hash code is the same as the pre-hash code, the authenticity of the data has been validated.
Asymmetric encryption is at work in every server that offers a secure purchase. It all happens silently in the background. You will know you’re secure if you see that small SSL lock key in your browser.
Types of Encryption Algorithms
The strength of encryption is vital as attempts to steal data are becoming more frequent. These days, many cybercriminals use a brute-force attack to penetrate security. This means that the hacker keeps trying different key combinations to decode the encryption.
For this reason, encryption algorithms need to be strong. According to experts, the key size is indicative of the strength of the encryption. Although most modern ciphers are secure, advanced computer technology or a small flaw in the encryption algorithm can make it much easier to break.
Here are some of the currently most commonly used encryption algorithms and their uses:
Data Encryption Standard (DES)
This algorithm was the first standard the US government promoted for businesses and government agencies. However, with the introduction of new algorithms, it has become functionally obsolete. It is still in use today, but mostly in low-security applications and products with slow processors that cannot process large keys.
This is the improved version of DES and, as the name implies, it runs three phases of encryption. The first two encryption phases encrypt the data and the last one encodes the result. The key length is 168 bits, which is still strong.
Developed by two Belgian cryptographers, AES was based on an algorithm called Rijndael. It creates an encryption key of up to 256 bits, making it the new standard of encryption. Because of performance considerations, however, the AES is usually used in either a 128-bit or 192-bit mode.