Cryptography and its Types (original) (raw)

Last Updated : 12 Dec, 2025

Cryptography is the science of protecting information using mathematical techniques to ensure confidentiality, integrity, and authentication. It transforms readable data into unreadable form, preventing unauthorized access and tampering.

crptography

These algorithms are used for cryptographic key generation, digital signing, and verification to protect data privacy, web browsing on the internet and to protect confidential transactions such as credit card and debit card transactions.

Features Of Cryptography

The features of cryptography that makes it a popular choice in various applications could be listed down as

features_of_cryptography

  1. Confidentiality: Information can only be accessed by the person for whom it is intended and no other person except him can access it.
  2. **Non-repudiation: The creator/sender of information cannot deny his intention to send information at a later stage.
  3. Integrity: Information cannot be modified in storage or transition between sender and intended receiver without any addition to information being detected.
  4. Adaptability: Cryptography continuously evolves to stay ahead of security threats and technological advancements.
  5. Interoperability: Cryptography allows for secure communication between different systems and platforms.
  6. Authentication: The identities of the sender and receiver are confirmed. As well destination/origin of the information is confirmed.

Working of Cryptography

As we all know that cryptography technique is use to convert plain text into ciphertext. This technique is done by cryptographic key. Basically cryptographic key is a string of characters which is used to encrypts the data and decrypt the data.

cryptography

Here,

"Hello" is a plaintext and convert into ciphertext "jknnq" with the help of cryptographic key and then decrypt into "Hello".

Types Of Cryptography

There are three types of cryptography, namely Symmetric Key Cryptography, Asymmetric Key Cryptography and Hash functions, here's a detailed explanation below:

Types-of-Cryptography

1. Symmetric Key Cryptography

Symmetric Key Cryptographyis an encryption system where the sender and receiver of a message use a single common key to encrypt and decrypt messages.

Symmetric Key Cryptography

Symmetric Key Cryptography

Example:

**Data Encryption Standard (DES)

DES (Data encryption standard) is an older encryption algorithm that is used to convert 64-bit plaintext data into 48-bit encrypted ciphertext.

Data-Encryption-Standard

**Example of DES Encryption and Decryption tool:

**AES (Advanced Encryption Standard):

AES s a popular encryption algorithm which uses the same key for encryption and decryption.

AES-vs-DES-encryption_

**Example for Encryption and Decryption of AES tool.

2. Hash Functions

Hash functions do not require a key. Instead, they use mathematical algorithms to convert messages of any arbitrary length into a fixed-length output, known as a hash value or digest.

Hash functions are designed to be one-way, meaning the original input cannot be derived from the output.

Given Below, Some of the most widely used hash functions include:

**SHA-1:

SHA1

SHA-1

**Example of SHA-1 Hash Generator

sha-1

Example

**SHA-256:

sha_256

SHA-256

Example:
Data : geeksforgeeks
SHA256 : f8d59362da74ffe833332dc20508f12de6da6a9298c98b3b42873e7298fced78

**MD5:

MD5-Hashing

MD5

**MD6:

MD6-Hashing

MD6 Hashing

**Example of MD6 Hash Generator

md6

Example

3. Asymmetric Key Cryptography

In Asymmetric Key Cryptography a pair of keys is used to encrypt and decrypt information. A sender's public key is used for encryption and a receiver's private key is used for decryption. Public keys and Private keys are different. Even if the public key is known by everyone the intended receiver can only decode it because he holds his private key. The most popular asymmetric key cryptography algorithm is theRSA algorithm.

Asymmetric Key Cryptography

Asymmetric Key Cryptography

Examples:

RSA (Rivest-Shamir-Adleman):

RSA is an basic asymmetric cryptographic algorithm which uses two different keys for encryption. The RSA algorithm works on a block cipher concept that converts plain text into cipher text and vice versa.

how_rsa_encryption_works

Encryption in RSA

**Example:

Choose p = 3 and q = 11
Compute n = p * q = 3 * 11 = 33
This n is part of the public key and also used in both encryption and decryption
Computer Euler's function φ(n)
ϕ(n)=(p−1)(q−1)=(3−1)(11−1)=2×10=20
Choose e such that 1 < e < φ(n) and e and φ (n) are coprime. Let e = 7
Compute a value for d such that (d * e) % φ(n) = 1. One solution is d = 3 [(3 * 7) % 20 = 1]
Public key is (e, n) = (7, 33)
Private key is (d, n) = (3, 33)

**Encyption:
Let’s say the message M=4 (must be < n)
Ciphertext C=M^e modn=4^3 mod33=64 mod33=31
Encrypted Message = 31

**Decryption:
M=C^d modn=31^7 mod33
Use modular Exponential

Now, 1984 mod 33 = 4

Decrypted Message= 4

ECC (Elliptic Curve Cryptography):

lliptic Curve Cryptography (ECC) is a type of asymmetric encryption that provides strong security with smaller keys than RSA. It’s efficient, fast, and ideal for devices with limited resources like smartphones, IoT devices, and blockchain wallets. ECC is widely used in secure communications such as TLS/SSL and cryptocurrencies due to its lightweight yet powerful encryption.

curve

Elliptic Curve

**Equation:

We use the standard elliptic curve equation: y^2 = x^3 + ax + b mod p
Let's choose:

So the curve becomes: y^2 = x^3 + x + 1 mod 23

**Applications of Cryptography

Cryptography has wide area of applications in the modern world, where the technology is rapidly evolving. These are some of the most common applications of cryptography listed below:

applications_of_cryptography

Applications

**1. Password Security: Passwords are hashed before storage to prevent exposure even if the database is leaked.

**2. Digital Currencies: Bitcoin and other cryptocurrencies use cryptography for transaction integrity and identity protection.

**3. Secure Web Browsing (HTTPS): SSL/TLS protocols encrypt communication between browser and server.

**4. Electronic Signatures: Legally valid digital signatures created using public-key cryptography.

**5. Authentication Systems: Used in bank logins, secure networks, and access control systems.

**6. End-to-End Encryption: Messaging apps like WhatsApp and Signal ensure only intended users read the messages.

Classical Ciphers

Ciphers are methods used to transform readable data (plaintext) into unreadable data (ciphertext) so that only authorized parties can understand the original content.

cipher

Cipher

**Examples

**Categories of Ciphers:

There are mainly two types of Classical Ciphers

**1. Substitution Ciphers: Replace characters with other characters using a defined rule

**Example:

In Caesar Cipher, A → D, B → E, etc.

**Real-Life Use: Simple password obfuscation, CTFs, and puzzle challenges.

**2. Transposition Ciphers: Rearrange the order of characters without changing them.

**Example:

Rail Fence Cipher, where characters are written in a zigzag and read row by row.

**Real-Life Use: Basic message encoding to confuse readers.

Types of Classical Ciphers

There are basic types of Classical Ciphers.

Cipher Name Description Real-life/CTF Use
**Caesar Cipher Each letter is shifted a fixed number of places. Hidden messages in simple malware, games, or emails.
**Vigenère Cipher Uses a keyword to shift letters; more secure than Caesar. Used in older secret messages and CTF puzzles.
**Atbash Cipher A → Z, B → Y… Reverses the alphabet. Often seen in basic stego/crypto challenges.
**ROT13 A Caesar Cipher with a shift of 13. Used in hiding spoilers or light obfuscation online.
**Rail Fence Cipher A form of transposition cipher that rearranges the order. Great for simple puzzles and password hiding.

Steganography

Steganography is the practice of concealing information. It involves hiding data within an ordinary, non-secret file or message to prevent detection. The hidden information is being extracted at the receiving end. Often, steganography is combined with encryption to add an extra layer of security for the hidden data. With the help of Steganography, we can hide any digital content virtually like text, image, videotape, etc.

Common Types of Steganography:

Here are the types mentioned below about Steganography

**Image Stego (LSB)

**Text Stego

**Audio Stego

**Video Stego

**Metadata Stego

steno

Steganography

Here are the basic tool of Steganography

Tool Use
**Steghide Hide/extract data from images/audio
**zsteg Analyze PNG/BMP for hidden messages
**ExifTool Extract hidden metadata in images
**binwalk Extract hidden content in binaries
**strings Find readable data inside files
**stegsolve.jar GUI tool to analyze and dissect images

Hands-On Practice

Lets try ciphering a phrase and how it works.