Skip to main content

Cryptography and Encryption

In the digital world, trust depends on one simple thing, whether data is safe and private. That’s exactly what cryptography does.

It ensures that your messages, passwords, and transactions can only be understood by the people who are meant to see them, and no one else.


What Is Cryptography?

Cryptography is the practice of securing information by transforming it into a form that cannot be understood by unauthorized people.

It comes from two Greek words:

  • Krypto (hidden)
  • Graphy (writing)

So, cryptography literally means “hidden writing.”

It’s how your WhatsApp chats stay private, your bank transactions remain secure, and your passwords aren’t readable to hackers.


The Core Goals of Cryptography

Cryptography isn’t just about hiding data, it’s about protecting it in four key ways (often called the “CIAA principles”):

PrincipleMeaningExample
ConfidentialityKeeps data secret from unauthorized usersEncrypting messages so only the recipient can read them
IntegrityEnsures data isn’t altered during transmissionDetecting tampered files
AuthenticationConfirms the identity of usersDigital signatures or certificates
Non-repudiationPrevents users from denying their actionsProof that a sender really sent a message

How Cryptography Works

Cryptography works by converting readable data (plaintext) into an unreadable form (ciphertext) using a key.

Here’s the basic process:


Plaintext → Encryption → Ciphertext
Ciphertext → Decryption → Plaintext

Let’s visualize it:

StepActionExample
1️⃣You write: “Hello Ajay”(Plaintext)
2️⃣Encryption turns it into: “H8$k*20z!”(Ciphertext)
3️⃣The receiver decrypts it with a secret key(Plaintext restored)

Without the right key, the message is meaningless, that’s the power of encryption.


Types of Cryptography

There are two main types of cryptography, each with different purposes and use cases.


1. Symmetric Encryption

In symmetric encryption, the same key is used to encrypt and decrypt data. It’s fast and efficient but risky, because if the key is leaked, the attacker can decrypt everything.

Example:

  • Algorithms: AES, DES, Blowfish
  • Real-life use: Encrypting files on your computer
Sender and Receiver share one secret key.
ProsCons
Fast and efficientKey sharing is risky
Works well for large dataLess secure if key is exposed

2. Asymmetric Encryption

In asymmetric encryption, two keys are used:

  • Public Key: Shared openly
  • Private Key: Kept secret

Whatever is encrypted with one key can only be decrypted by the other.

Example:

  • Algorithms: RSA, ECC
  • Real-life use: HTTPS websites, emails, digital signatures
Public Key → Encrypts message
Private Key → Decrypts message
ProsCons
More secure (no key sharing needed)Slower than symmetric
Perfect for communication over the internetComplex to manage

Example: How Encryption Works on WhatsApp

When you send a message on WhatsApp, it uses end-to-end encryption:

  • Your device encrypts the message before sending it.
  • Only the recipient’s private key can decrypt it.
  • Even WhatsApp itself can’t read your chat.

So even if a hacker intercepts your message, they’ll only see scrambled data like:

@2h1Lx9!d0eP#rW8Z

That’s encryption in action, invisible but powerful.


Common Encryption Algorithms

AlgorithmTypePurposeNotes
AES (Advanced Encryption Standard)SymmetricFile & data encryptionVery secure and widely used
DES (Data Encryption Standard)SymmetricLegacy encryptionNow outdated due to weaknesses
RSAAsymmetricSecure key exchange & authenticationUsed in HTTPS and emails
ECC (Elliptic Curve Cryptography)AsymmetricModern lightweight encryptionUsed in mobile & IoT devices
SHA (Secure Hash Algorithm)HashingEnsures integrityUsed in passwords & digital signatures

Cryptography in Everyday Life

You use cryptography every single day — often without realizing it.

SituationTechnology Used
Logging into GmailSSL/TLS encryption
Online paymentsRSA + AES
Saving passwordsHashing (SHA/Bcrypt)
Sending messages on WhatsAppEnd-to-end encryption
Accessing websites (HTTPS)Digital certificates

Without cryptography, modern life would be wide open to cyberattacks.


Hashing vs Encryption

These two terms often get mixed up — but they’re very different.

FeatureEncryptionHashing
PurposeHide data but make it reversibleVerify data integrity (one-way)
Reversible?Yes (with key)No
ExampleAES, RSASHA-256, MD5
Common UseMessaging, data transferPassword storage

Hashing is like sealing a fingerprint — you can verify it but never reverse it.


Digital Signatures

A digital signature ensures that a message hasn’t been changed and confirms the sender’s identity.

It’s widely used in:

  • Email verification
  • Document signing (like PDFs)
  • Software authenticity (you’ve seen “Verified Publisher” in installers)

It combines hashing and encryption to provide authenticity + integrity.


Real-Life Example: HTTPS

When you visit a website with HTTPS:

  1. Your browser checks the site’s digital certificate.
  2. It uses asymmetric encryption (RSA) to exchange keys.
  3. Then switches to symmetric encryption (AES) for fast data transfer.

That’s how your data (like login credentials or credit card info) stays safe online.


Summary

Let’s recap what we learned:

  • Cryptography protects digital information from unauthorized access.
  • Encryption transforms data into unreadable code using keys.
  • Two main types — Symmetric (same key) and Asymmetric (public/private keys).
  • Hashing ensures integrity but is irreversible.
  • Cryptography powers everything from WhatsApp to online banking.

What’s Next

In the next tutorial, you’ll explore Ethical Hacking & Cyber Defense — how experts use hacking techniques for good to strengthen systems.

Continue learning: Ethical Hacking & Cyber Defense ›