Understanding Cryptography Types: Symmetric, Asymmetric, Hash and More…

what-is-cryptography-geekflare

Cryptography is a technique to secure information and communication by using a set of rule-based calculations called algorithms and some mathematical concepts so only the right person can understand it.

It is useful to prevent unauthorized access to information.

The word “cryptography” is derived from the Greek word kryptos, which means hidden. The word “crypto” means “hidden” and “graphy” means “writing”.

In this article, I will cover the basics of cryptography principles, explore various types with examples, discuss challenges, and look ahead to future trends. I aim to provide a comprehensive overview, covering both major and minor concepts.

Cryptography secures digital communication and information in various systems and applications, ensuring confidentiality and data security. It protects data from unauthorized access.

cryptography.drawio-1-1

Let’s see what happens in cryptography:

  1. The process starts with the sender who has a message or data to send.
  2. The plaintext (original message) is then converted into an unreadable format using a method called encryption.
  3. The receiver uses a key to convert the ciphertext (unreadable format) back into a readable format, a process known as decryption.
  4. The decrypted message is again in plaintext and is the same as the original message sent by the sender.
  5. The receiver now has the original message.

Now, let’s explore the fundamental principles of cryptography.

Basic Principles of Cryptography

There are four main principles of cryptography:

#1. Confidentiality: Only the intended recipient can access the information; it remains private to others.

#2. Integrity: Information cannot be altered during storage or transmission without detection of any changes.

#3. Non-repudiation: The sender cannot deny sending the information later on.

#4. Authentication: It confirms the identities of both sender and receiver and verifies the source and destination of the information.

Before we continue, let’s go over some basic vocabulary.

Glossary:

symmmetric-cryptography

Let’s understand the process through the following steps:

This symmetric encryption process makes sure that the communication between sender and receiver remains secure. But, the secret key needs to be confidential.

To maintain confidentiality and integrity, both parties must securely manage and protect this secret key.

There are two types of symmetric encryption ciphers:

Symmetric-vs-Asymmetric.drawio-1

  1. Stream Cipher
  2. Block Cipher

It’s important to understand that you can’t figure out the private key from the public key. Also, public keys are usually linked to identities by organizations known as Certificate Authorities.

Secure Communication Sender and Receiver have exchanged a secure message without compromising their private keys.

These algorithms rely on mathematical problems like integer factorization and discrete logarithms to create digital signatures and establish/distribute session keys, such as in the TLS protocol.

Some examples of asymmetric encryption algorithms include:

Advantages of Asymmetric Cryptography

Disadvantages of Asymmetric Key Cryptography

But, no need to worry organizations and researchers are working to transition to these quantum-resistant cryptographic techniques.

Let’s move toward our next type of cryptography:

Hash Function

Cryptographic hash functions are different from other types of cryptography. They don’t encrypt data. Instead, they use complex math to turn any data into a unique code made up of letters and numbers.

These codes are called hash codes, hash values, or message digests. They’re important for checking if data is safe; when data is sent or stored, its hash code is calculated and sent or kept with the data.

The recipient can recalculate the code of the data they received and check it against the one sent. If the codes match, it means the data stayed safe during transmission and storage.

Here’s a simple step-by-step explanation:

Hash-Function-new.drawio-1

Sender’s Side:

  1. The sender uses a hash function to create a unique hash value for the provided data.
  2. After creating hash values, the sender sends both the original message and the hash code to the receiver through an insecure channel.

Receiver’s Side:

  1. The receiver receives the message and the hash code.
  2. The receiver also uses the same special tool (hash function) to create a new hash code for the received message.
  3. The receiver compares the new hash code with the one sent by the sender.

Outcome:

Here are some of the properties that make hash functions useful:

Properties of Hash Function:

  1. Deterministic: If you give the same input, It will always produce the same output.
  2. Uniformity and Collision Free: A good hash function should produce uniformly distributed outputs. It helps to avoid collisions.
  3. Efficient: Hash functions are designed to be computationally efficient, allowing them to quickly process large amounts of data.
  4. Fixed-Size Output: It produces a fixed-size output regardless of the input size. This property is essential because it enables efficient storage and retrieval of data.

Hash functions have many applications in computer science and information security, including cryptography, data integrity checking, data indexing, data fingerprinting, password storage, digital forensics, and blockchain.

Commonly used cryptographic hash functions include:

There are two widely used families of cryptographic hash functions –the MD family (MD = message digest) and the SHA family (SHA = secure hash algorithm).

Even though hash functions do not encrypt messages, they are an integral part of cryptography because they play a crucial role in securing and authenticating data, which are key goals in cryptography.

Advantages of Hash Function

Disadvantages of Hash Function

applications-of-cryptography-geekflare

Real-life Applications of Cryptography

challenges-in-cryptography-geekflare

Challenges in Cryptography

This speed threatens the foundation of our current cryptographic systems, which rely on the complexity of certain mathematical challenges to ensure data security. Quantum computers have the capability to crack these problems much faster than conventional computers, potentially compromising the safety of our encryption methods.

The underlying principles of quantum mechanics that quantum computers utilize are indeed unusual but grant them the power to perform tasks that are beyond the reach of classical computers.

Consequently, the need to develop novel cryptographic techniques that can withstand quantum attacks is becoming increasingly pressing, creating an ongoing challenge within the field of cryptography.

Future Trends in Cryptography

Final Words

Cryptography is a vast field with much to explore, and we have only scratched the surface by covering the basics of cryptography.

We’ve covered cryptography, its principles, cryptography types, hash functions, challenges, future trends, and practical applications.

Yet, there’s much more to discover.