Exploring Different Types of Cryptography

The Hackers Meetup
8 min readMay 4, 2024

Cryptography is a reliable shield in a world when data security and privacy are crucial. Over the course of decades, cryptography — the art and science of secure communication — has changed to accommodate shifting encryption techniques and technological advancements. We set out on a quest to discover the various forms of encryption that are essential to protecting our online existence in this blog.

The process of encrypting data and communications with codes so that only the intended recipient can decipher and process them is known as cryptography. The meaning of the prefix “crypt” is “hidden,” and the suffix “graphy” is “writing.” The methods used in cryptography to safeguard data are derived from mathematical ideas and a system of computations based on rules, or algorithms, which transform signals into forms that are difficult to decipher. These algorithms are used to generate cryptographic keys, digitally sign documents, verify data privacy, browse the internet, and safeguard private transactions like debit and credit card purchases.

Features Of Cryptography are as follows:

1. Confidentiality

2. Integrity

3. Non-repudiation

4. Authentication

CRYPTOGRAPHY — WITH AN EXAMPLE

Let’s examine the operation of WhatsApp encryption. Of all the applications of cryptography in daily life, this is one that most of us are undoubtedly familiar with. The social media platform WhatsApp protects user privacy by encrypting all data between its nodes.

This implies that every text message, picture, and video sent using WhatsApp is encrypted. WhatsApp is an example of end-to-end encryption, which implies that it is coded so that only the individuals who were at the sending and receiving end may access it.

TYPES OF CRYPTOGROPHY:

SYMMERTIC KEY CRYPTOGRAPHY

Symmetric encryption, also known as secret key encryption, is a fundamental cryptography utilized in many different applications, from protecting stored data to securing communication channels, because of its effectiveness and simplicity. The difficulty, though, is in safely transferring the secret key between the parties without being intercepted, which frequently calls for further key management or cryptographic methods. Even with this drawback, symmetric encryption algorithms — such as AES (Advanced Encryption Standard) — remain essential to contemporary cryptography because they provide strong security and excellent performance while safeguarding confidential data. This is the approach, where the same key is used for both encrypting and decrypting data. This indicates that in order to convert plaintext into ciphertext and vice versa, the communicating parties must exchange a secret key.

Even if symmetric encryption is more traditional, it is still quicker and more effective than asymmetric encryption, which strains networks with large data sets and high CPU usage. Symmetric cryptography is commonly employed for bulk encryption, or encrypting huge amounts of data, such as database encryption, due to its superior performance and faster speed when compared to asymmetric encryption. When it comes to databases, it’s possible that the secret key is only accessible to the database for encryption or decryption. Comparing industry-standard symmetric encryption to existing (as of writing) standards for asymmetric algorithms, the former is also less susceptible to improvements in quantum computing.

Here are a few instances of applications for symmetric cryptography:

  • Payment apps, like card transactions, require the protection of personally identifiable information (PII) to avert identity theft and fraudulent charges.
  • Verifications to verify that the person sending a communication is indeed who they say they are.
  • Hashing or generating random numbers.

Types

You can employ block ciphers or stream ciphers with symmetric-key encryption.

Stream ciphers encrypt a message one character at a time, usually in the form of bytes, or letters in the case of substitution ciphers. ChaCha20 is one such. Although substitution ciphers are widely used, they are easily cracked with a frequency table.

Block ciphers pad the plaintext to obtain a multiple of the block size by taking multiple bits and encrypting them in a single unit. NIST adopted the Advanced Encryption Standard (AES) algorithm in December 2001; it uses 128-bit blocks.

Advanced Encryption Standard (AES)

Symmetric Cryptography, exemplified by the Advanced Encryption Standard (AES), is a cornerstone of modern information security. AES offers robust security and efficiency, operating on fixed block sizes and supporting various key lengths. Its resistance to cryptographic attacks and versatility in both software and hardware implementations make it indispensable for securing sensitive data across diverse applications. From encrypting files to safeguarding network communications, AES plays a vital role in ensuring confidentiality and integrity in an ever-evolving digital landscape.

One of the key strengths of AES lies in its resistance to various cryptographic attacks, including brute-force attacks. With its large key space, even the most powerful computing resources would require an infeasible amount of time to exhaustively search for the correct key.

In practical terms, AES is employed in a myriad of applications, ranging from encrypting sensitive files and communications to securing data transmission over networks. It serves as the foundation for secure communication protocols like TLS/SSL, ensuring the confidentiality and integrity of data exchanged over the internet.

Data Encryption Standard (DES)

The Data Encryption Standard (DES) stands as a pioneering example of symmetric encryption, laying the groundwork for modern cryptographic techniques. Developed in the 1970s, DES operates on a 64-bit block size and employs a 56-bit key for encryption and decryption. Despite its age, DES played a crucial role in establishing secure communication protocols and encryption standards. However, due to advances in computing power and cryptographic attacks, DES is now considered outdated and vulnerable to brute-force attacks. Nonetheless, its legacy persists in the form of Triple DES (3DES), which applies the DES algorithm multiple times for enhanced security. While DES may have been surpassed by more advanced encryption standards like AES, its historical significance and contributions to the field of cryptography remain noteworthy.

Triple Data Encryption Standard (3DES)

Triple Data Encryption Standard (3DES) is an enhancement of the original DES algorithm, providing increased security by applying the DES algorithm three times consecutively. Despite its improved resilience against brute-force attacks, 3DES has largely been supplanted by more modern encryption standards like AES due to its slower processing speeds and limited key sizes. However, it still finds occasional use in legacy systems where compatibility with older encryption protocols is necessary.

ASYMMERTIC KEY

A pair of keys is used in asymmetric encryption, commonly referred to as public-key cryptography, to encrypt and decrypt data. The set of keys consists of a public key that the owner can share with anybody and a private key that they keep private. Asymmetric encryption encrypts data using the public key of the recipient, which is used by the sender. After that, the recipient decrypts the contents using their private key. With this method, two people can communicate securely without requiring each other to hold the same secret key. Comparing symmetric encryption — which use the same key for both encryption and decryption — with asymmetric encryption reveals a number of advantages. One of the primary benefits is that it does away with the necessity of exchanging secret keys, which can be difficult, particularly when speaking with several people at once. Asymmetric encryption algorithms include Elliptic Curve Cryptography (ECC), Diffie-Hellman, and RSA. Public-key cryptography, also referred to as asymmetric encryption, uses two different keys for encryption and decoding. The owner of the public key maintains the privacy of the private key, which is kept secret, while the public key is made public. A communication can be encrypted by anybody using the public key, but it can only be unlocked by the owner of the private key. Everyone has the ability to send a secure message to the owner of the public key without fear of the communication being intercepted and read by a third party. For secure online communication, such as email encryption, e-commerce, and online banking, asymmetric encryption is widely employed. Another use for digital signatures is in verifying the authenticity of digital documents and messages.

Advantages of Asymmetric Encryption

  • Enhanced Security
  • Authentication
  • Non-repudiation
  • Key distribution
  • Versatility

Types:

RSA (Rivest-Shamir-Adleman):

One of the most important asymmetric encryption algorithms in modern cryptography is RSA (Rivest-Shamir-Adleman). Based on the difficulty of factoring huge prime numbers, it works on the idea of using two keys: a public key for encryption and a private key for decryption. RSA is widely used in key exchange protocols, digital signatures, and secure communication in a variety of applications. Even while RSA requires more computing power than symmetric encryption, its strong security and adaptability have cemented its place as a mainstay of cryptographic systems all around the world.

Elliptic Curve Cryptography (ECC)

It is a type of public-key cryptography that uses elliptic curves’ mathematical characteristics to protect data and enable secure communication. Since ECC may achieve equal security with smaller key sizes, it has advantages over standard cryptographic algorithms in terms of faster computing and less bandwidth utilization. It is extremely resistant to assaults since its security depends on how hard it is to solve the elliptic curve discrete logarithm problem (ECDLP). ECC is a key component of contemporary cryptographic standards and protocols like TLS for secure internet communication and cryptocurrency systems like Bitcoin and Ethereum. It is widely used in many applications, including digital signatures, key agreement protocols, and encryption. Overall, ECC makes a substantial contribution to the field of contemporary cryptography and is a strong and effective instrument for ensuring secure communication and data protection in a variety of situations.

HASH FUNCTION

A key element of contemporary cryptography is the hash function, which serves to transform arbitrary-sized input data into a fixed-length character string that is usually a hash value or digest. Hashing is the act of creating a distinct digital fingerprint for every input, which makes it perfect for applications like digital signatures, data integrity verification, and password storage. Key characteristics of hash functions include collision resistance (it is hard to find two different inputs that produce the same hash value), preimage resistance (it is computationally impossible to reverse the hash value to obtain the original input), and determinism (the same input always produces the same hash value).

SHA-1, SHA-2, and SHA-3 from the Secure Hash Algorithm (SHA) family and MD5 (Message Digest Algorithm 5) are examples of frequently used hash functions. The SHA algorithms are widely used in cryptographic protocols, digital signatures, and data integrity verification systems, and they provide varied degrees of security, however MD5 is currently regarded as cryptographically broken due to flaws. All things considered, hash functions are essential to maintaining the security and integrity of data in a variety of cryptographic applications. By comparing hash values before and after transmission, they offer a way to confirm the authenticity of data and identify any changes or tampering. By hashing passwords before saving them, hash functions also play a crucial role in securely storing passwords. This reduces the possibility that plaintext passwords may be exposed in the event of a data breach.

Written by:

~ Deepak Rodge

--

--

The Hackers Meetup

Initiative of @viralparmarhack to provide a proper platform for cyber security researchers & like-minded people to establish a community.