ellipticc
Overview
Cryptography Explained Simply: The Concepts That Actually Matter

Cryptography Explained Simply: The Concepts That Actually Matter

Cryptography solves real problems in a connected world: keeping data private, ensuring it hasn’t been tampered with, and proving who sent it. But it’s not magic; understanding the basics reveals why security fails and how to evaluate it.

Why Cryptography Exists

Cryptography addresses three core problems:

  • Privacy: Hiding data from eavesdroppers
  • Integrity: Detecting if data was altered
  • Authenticity: Verifying the source of data

It doesn’t solve social engineering, physical theft, buggy code, or quantum threats (yet). Crypto is a technical tool, not a complete security solution.

Secrets, Keys, and Trust

Keys are the foundation: random numbers that enable encryption, decryption, and verification. Unlike passwords (human-memorable), keys are long, random strings used directly in crypto operations.

Passwords become keys through “key derivation functions” (KDFs) like PBKDF2 or Argon2, which stretch weak passwords into stronger ones by adding computational work.

Trust is everywhere: you trust the software generating keys, the channels distributing them, and your storage. Compromise any part, and security breaks.

The Three Building Blocks

Cryptography rests on three fundamental operations: encryption, hashing, and digital signatures. These are the basic tools that make everything else possible. Let’s break them down step by step, like learning to cook; you start with ingredients, then learn recipes.

Encryption: Hiding Your Message

Encryption is like putting your letter in a locked box. Only someone with the right key can open it and read what’s inside.

How it works (simple version): You take your message (plaintext) and scramble it using a secret key, turning it into gibberish (ciphertext). To read it, you unscramble with the same (or matching) key.

There are two main types:

Symmetric Encryption (Shared Secret):

  • Uses one key for both locking and unlocking.
  • Like a padlock where both people have the same key.
  • Fast and efficient for encrypting large files or streams of data.
  • Common algorithms:
    • AES (Advanced Encryption Standard): The gold standard. Uses 128, 192, or 256-bit keys. Think of it as a super-secure lock with billions of possible combinations. Used everywhere: your phone, Wi-Fi, hard drives.
    • ChaCha20: A newer, faster alternative to AES. Great for mobile devices and when speed matters. Often paired with Poly1305 for extra security (ChaCha20-Poly1305).

For more info, visit our article: Authenticated Encryption: Why AES-GCM and ChaCha20-Poly1305 Are the Real Heroes

Asymmetric Encryption (Key Pairs):

  • Uses two keys: public (for locking) and private (for unlocking).
  • Like a mailbox: anyone can put mail in (with your public key), but only you can open it (with your private key).
  • Slower than symmetric, so used for smaller things like sharing keys.
  • Common algorithms:
    • RSA: Relies on multiplying huge prime numbers. Keys are 2048-4096 bits long. Been around forever, but getting replaced due to quantum threats.
    • ECC (Elliptic Curve Cryptography): Uses math with curves (don’t worry, no equations here). Smaller keys (256 bits) but same security as RSA with 3000+ bits. More efficient, used in modern systems like HTTPS.

Why both? Symmetric is fast for data; asymmetric solves the “how do I share the key?” problem.

Hashing: Creating a Unique Fingerprint

Hashing is like taking a photo of your document that can’t be reversed. It’s a one-way process that creates a fixed-size “summary” of any data.

How it works (simple version): Feed any amount of data into a hashing function, and it spits out a short, unique string (hash or digest). Change one letter in the input, and the hash completely changes. You can’t recreate the original data from the hash.

Think of it as a fingerprint: every person has a unique one, but you can’t rebuild the person from their fingerprint.

Key properties:

  • Deterministic: Same input always gives same hash.
  • One-way: Can’t reverse to get original data.
  • Collision-resistant: Extremely hard to find two different inputs with the same hash.
  • Avalanche effect: Tiny input change = huge hash change.

Common uses:

  • Password storage: Store hash of password, not the password itself. When you log in, hash your input and compare.
  • File integrity: Download a file, check its hash against the official one to ensure it wasn’t tampered with.
  • Digital forensics: Prove a file hasn’t changed.

Practical Example: Verifying a Debian ISO Download

Let’s say you want to download Debian Linux (a free operating system). You go to their website and download the file debian-13.2.0-amd64-netinst.iso from https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.2.0-amd64-netinst.iso.

Debian provides official hashes to verify your download is authentic and uncorrupted. Here’s how it works:

  1. Download the file: Get the ISO from the link above.

  2. Get the official hashes: Debian publishes these on their site. For this file:

    • SHA256: 677c4d57aa034dc192b5191870141057574c1b05df2b9569c0ee08aa4e32125d
    • SHA512: 891d7936a2e21df1d752e5d4c877bb7ca2759c902b0bfbf5527098464623bedaa17260e8bd4acf1331580ae56a6a87a08cc2f497102daa991d5e4e4018fee82b
  3. Compute the hash yourself: On your computer, run a command to hash the downloaded file:

    • On Linux/Mac: sha256sum debian-13.2.0-amd64-netinst.iso
    • On Windows (PowerShell): Get-FileHash -Algorithm SHA256 debian-13.2.0-amd64-netinst.iso
  4. Compare: If your computed hash matches the official one, the file is intact. If not, it was corrupted in download or tampered with.

This ensures you’re installing genuine Debian, not malware disguised as an OS.

Popular hashing algorithms:

  • SHA-256: Part of the SHA-2 family. Creates 256-bit hashes. Used in Bitcoin, HTTPS certificates, Git commits.

For more info, visit our article: What is SHA? Deep Dive

  • SHA-3: Newer, more secure. Designed to resist quantum attacks.
  • Blake2: Fast and secure alternative to SHA-256.

Why secure? Even if someone steals your password hashes, they can’t reverse them to get passwords. But weak passwords can still be guessed via “rainbow tables” (precomputed hash dictionaries), so always add salt (random data) to make each hash unique.

Digital Signatures: Proving Authenticity

Signatures are like signing a check: they prove you approved something and it hasn’t been changed.

How it works (simple version):

  1. You hash your message (create fingerprint).
  2. Encrypt that hash with your private key (only you have it).
  3. Send message + encrypted hash (signature).
  4. Recipient decrypts signature with your public key, gets the hash.
  5. They hash the message themselves and compare.

If they match, the message is authentic and unchanged.

Why it works:

  • Only you could have created the signature (private key).
  • If message changed, hashes won’t match.
  • Public key verifies without revealing your private key.

Real-world example: Email signatures, software updates, blockchain transactions.

Practical Example: Verifying Debian ISO with Signatures

Building on the hashing example, Debian also signs their releases with digital signatures for extra security.

  1. Download the signature file: Alongside the ISO, download SHA256SUMS.sign or similar from the same directory.

  2. Verify the signature: Debian’s public key is widely distributed. You import it and verify:

    • Command: gpg --verify SHA256SUMS.sign SHA256SUMS
  3. Then verify the hash: Once the hash file is authenticated via signature, check your ISO against it.

This two-layer approach (hash + signature) ensures the file is both intact and from Debian. Signatures prevent attackers from publishing fake hashes.

Common signature algorithms:

  • RSA signatures: Same math as RSA encryption. Sign with private key, verify with public key.
  • ECDSA (Elliptic Curve Digital Signature Algorithm): Uses ECC. Smaller signatures, more efficient. Used in Bitcoin and TLS.
  • EdDSA: Modern ECC-based signatures. Even better security properties.

Difference from encryption: Encryption hides content; signatures prove who sent it and that it’s intact.

These three building blocks (encryption, hashing, signatures) are the foundation. Everything in crypto builds on them, from secure websites to encrypted drives.

Note

Pro Tip: Understanding these basics helps you spot weak security. Next time you see “encrypted” claims, ask yourself: encrypted with what key, verified how?

Symmetric vs Asymmetric Crypto

Symmetric: Single shared key for both operations. Fast, efficient for encrypting large amounts of data. Problem: how to share the key securely?

Asymmetric: Public/private key pairs. Public key encrypts (anyone can send you encrypted messages), private key decrypts (only you can read). Enables digital signatures too.

Real systems use hybrid approach: asymmetric for initial key exchange (e.g., TLS handshake), then symmetric for the session. This balances security and performance.

Authentication vs Encryption

Authentication proves identity (“You are who you claim”). Methods include passwords, biometrics, certificates.

Encryption protects content (“No one else can read this”).

Encryption without authentication is dangerous: encrypted data from an imposter is still encrypted garbage. Most attacks exploit this gap (e.g., man-in-the-middle).

Why Passwords Are Weak

Humans create poor secrets. Even “strong” passwords have low entropy: predictable patterns, dictionary words, reused across sites.

Key Derivation Functions (KDFs): Transforming Weak Passwords into Strong Keys

Passwords are human-memorable but cryptographically weak. KDFs solve this by “stretching” passwords into secure keys through repeated operations.

How PBKDF2 Works (Simple Explanation):

  1. Take your password (e.g., “password123”).
  2. Add salt (random bytes, e.g., “salt123”) to prevent rainbow table attacks.
  3. Hash the combination repeatedly (thousands of iterations).
  4. Output a fixed-size key (for example, 32 bytes = 256 bits).

Example (run locally to see actual output): Use Python to derive a 32-byte key with PBKDF2 and display it in hex:

import hashlib, binascii
password = b'password123'
salt = b'salt123'
key = hashlib.pbkdf2_hmac('sha256', password, salt, 10000, dklen=32)
print(binascii.hexlify(key).decode())

This prints a 64-character hex string (32-byte key). Do not reuse these example values in production; generate a new random salt and choose iteration counts appropriate for your environment.

This 32-byte key is suitable as an AES key. PBKDF2 turns a weak, human-memorable password into a cryptographically suitable key by adding work and randomness.

Other KDFs:

  • bcrypt: Adds memory cost, resisting hardware attacks.
  • scrypt: Memory and CPU intensive.
  • Argon2: Winner of Password Hashing Competition, balances all factors.

KDFs make brute-force attacks expensive; attackers must repeat the slow process for each guess.

But passwords remain weak links. Phishing, keyloggers, and shoulder-surfing bypass even strong derivation. Multi-factor authentication (MFA) adds layers, but passwords are fundamentally flawed for modern security.

Secure Channels & Forward Secrecy

Secure channels (like HTTPS/TLS) establish encrypted connections:

  1. Client/server exchange public keys
  2. Agree on symmetric session key
  3. Encrypt all traffic with that key

Forward secrecy (perfect forward secrecy) ensures past sessions stay safe if current keys are compromised. Achieved by ephemeral keys; new key pairs are generated for each session and never reused. If an attacker grabs your private key later, they can’t decrypt old conversations.

Without forward secrecy, compromising one key decrypts everything.

End-to-End Encryption: Guarantees and Limits

E2EE encrypts data on the sender’s device, decrypts only on recipient’s. Providers can’t read messages.

Guarantees: Content stays private from servers, ISPs, governments.

Limits: Metadata leaks: timestamps, participants, message frequency, file sizes. This reveals communication patterns, relationships, locations. In oppressive regimes, metadata alone enables surveillance.

E2EE protects the message; metadata betrays the context.

Zero-Knowledge (Demystified)

Zero-knowledge proofs (ZKPs) prove knowledge of a secret without revealing it. Example: Prove you know a password’s hash without sending the password.

Real ZKPs use complex math (e.g., SNARKs) for blockchain privacy or authentication. But “zero-knowledge” is overused in marketing; many “ZK” claims are just standard encryption.

True ZKPs are powerful but rare, expensive, and hard to implement correctly.

Post-Quantum Cryptography

Quantum computers threaten current crypto:

  • Shor’s algorithm: Factors large numbers, breaks RSA/ECC
  • Grover’s algorithm: Square-root speedup for symmetric search (doubles key sizes needed)

What survives: Symmetric crypto remains practical; Grover’s algorithm provides a square-root speedup, so increasing key sizes (for example, AES-128 → AES-256) restores security. Hash outputs should be lengthened similarly (e.g., SHA-256 → SHA-512) to maintain the same margin of security.

Migration is slow: PQ algorithms (like Kyber, Dilithium) are larger, slower, and less optimized. Most systems will use hybrid crypto: classical + PQ during transition.

Common Crypto Myths

  • Encrypted = secure: Encryption requires secure keys, implementations, and usage. Side-channels (timing, power analysis) leak info.
  • Hashes can be decrypted: Hashes are irreversible. Attacks use rainbow tables (precomputed hashes) or collisions (different inputs, same hash).
  • Private keys identify people: Private keys are random blobs. Public keys may link to identities via certificates, but private keys don’t.

How to Read Security Claims Critically

Avoid red flags: “military-grade,” “unbreakable,” “quantum-proof” without specifics.

Ask: How are keys managed? What’s the threat model? Open-source? Audited? How handled key compromise?

Systems > algorithms. Perfect crypto fails in broken systems.

Note

Looking for deeper dives? Read more on Authenticated Encryption: AES-GCM and ChaCha20-Poly1305 and What is SHA? Deep Dive.

Frequently Asked Questions

Final Takeaway

Crypto is a tool, not protection. It secures the math; people handle the rest. Understand basics to choose products wisely; ask “secure against what, for how long, and at what cost?”

Security is holistic: crypto + ops + humans.

Important

Ready to apply these concepts? Secure your files with zero-knowledge encryption using Ellipticc Drive - where your data is encrypted before it leaves your device.

Try Ellipticc Drive
ellipticc.
ellipticc.
ellipticc.
ellipticc.
ellipticc.
ellipticc.