cryptography?

cryptography?





You've probably encountered the term "cryptography" before. We're starting a series of explanatory articles on various cryptographic sciences, delving into their meanings and distinguishing between Hashing, Encoding, Encryption, and Obfuscation.


Let's begin with Encryption:

What is Encryption?

Encryption is the science of altering a specific word or message into a secret form, for example, changing it from one form to another, intending to securely send it to another party and avoid any attempts by third parties to discern the message's content.


This concept has a long history and has undergone significant evolutionary stages. Its most prominent use was during wars, notably in World War II with the advancement of communication devices using radio waves. Germany employed specific machines like the Enigma machine to transmit information and orders between Germany and its camps. This machine was a significant factor in Germany's advancement and superiority in the war until it was deciphered by a British scientist named Alan Turing.


This decryption was a major reason for the Allies' victory over Germany.


What does the encryption process involve?

The encryption process comprises three fundamental elements:

- The first element: The word or message intended for encryption, known as "plaintext."

- The second element: A key called the encryption key or simply "key." This key is combined with the plaintext to produce what's known as "ciphertext," which is the third element. The original message can only be accessed by reversing the mathematical equation using the same key used for encryption.


What are the types of cryptography?


There are two fundamental types of cryptography:


1. Symmetric Cryptography:

   Simply put, it involves using a single key. What does that mean?

   

   It means both parties agree on a shared key used for the encryption process (also known as Encryption) and the decryption process (also known as Decryption).

   

   The sending party starts by inputting the agreed-upon key into an encryption algorithm (Encryption Algorithm), of which there are many types. The most well-known type is AES (Advanced Encryption Standard).

   

   After this process, the result will be the encrypted message (Ciphertext). This message is then sent to the receiving party. In this scenario, if someone intercepts it—commonly referred to as a Man-in-the-Middle (MITM) or Adversary—they won't understand the content of the message or reverse the equation due to the absence of the key. Hence, the secrecy of the algorithm becomes less critical as the algorithm still depends on the key, essential for the decryption process.

   

   Once the other party receives the message, they can reverse the equation using the pre-agreed key, decrypting it to access the original plaintext message.


   The advantage of this type is its speed. However, one of its downsides is the agreement on the key, which can be intercepted by an attacker during the key agreement phase before encryption begins.


2. Asymmetric encryption:

In symmetric encryption, as we've learned, communication occurs between two parties: the sender and the receiver. It involves inputting the intended plaintext into an equation with a pre-agreed encryption key, resulting in ciphertext.


Here, the process operates similarly, but with two keys associated within the same chain. One key is termed the "Public Key," mathematically designed for encryption purposes only. The other key, known as the "Private Key," is intended solely for decrypting what has been encrypted with the Public Key.


As they belong to the same chain, their usage is interlinked...


How Asymmetric Encryption Works?


Assuming we have two parties:


The sender and the receiver wanted to send an extremely confidential message but found Symmetric Encryption insecure for them because it required them to agree on the key from the start. Hence, they decided to use Asymmetric Encryption.


The first party, the sender, will use equations to create two keys: public and private, each serving specific functions as previously mentioned. Since the public key is used for encryption only, the sender will share it with the receiver, posing no risk as it is solely used for encryption. The other key, the private key, used for decryption, will never leave the sender's device. Consequently, the sender will request the receiver to use their public key for encryption, and thereafter, the sender will decrypt using their stored private key. The receiver will create two keys in the same manner, sending their public key to the other party. Consequently, each party will have:


  • Their own private decryption key.
  • The public encryption key of the other party.

Each party will encrypt data using the other party's public key, and the other party will be responsible for decryption using their private key.


This method is more secure than symmetric encryption because the private decryption key will never leave the device. One of the most famous asymmetric encryption algorithms is RSA (Rivest-Shamir-Adleman). This method introduces the concept of "End to End Encryption."


There are numerous algorithms serving Asymmetric Encryption comprehensively, such as Al Gamal, authored by Dr. Taher Elgamal. The Deffie-Hellman algorithm also predates many other algorithms, focusing on the secure exchange of Public Keys.


However, each type has its drawbacks. One disadvantage of this method is slowness because it relies on key exchange between parties, requiring time for key exchange.

However, an effective method has been devised to overcome this slowness and enhance content security, achieved by using both methods together. 

How does this work? 

The first method employs Asymmetric Encryption, exchanging public keys where each party uses the other's public key to transmit another key specific to Symmetric Encryption. After agreement, Symmetric Encryption is used, as it overcomes the challenge of securely transmitting the key. This key is also encrypted using Asymmetric Encryption, employed in both SSL (Secure Sockets Layer) and PGP (Pretty Good Privacy).

Next Post Previous Post
No Comment
Add Comment
comment url