Introduction to
Cryptography

Master the art of secure communication. From ancient ciphers to modern encryption standards used in computer networks.

Interactive Simulations
Real-world Examples
Network Security Focus
Study Progress 0%

1. Cryptography Fundamentals

Understanding the core concepts that protect information in computer networks.

What is Cryptography?

Cryptography is the practice and study of techniques for secure communication in the presence of adversarial behavior. It ensures confidentiality, integrity, authentication, and non-repudiation.

  • Confidentiality: Only authorized parties can read the message
  • Integrity: Message hasn't been altered in transit
  • Authentication: Verify the identity of communicating parties

Basic Terminology

Plaintext Original readable message
Ciphertext Encrypted, unreadable form
Encryption Process of converting plaintext to ciphertext
Decryption Process of recovering plaintext from ciphertext
Key Secret information used for encryption/decryption

Interactive: Caesar Cipher

Experience the simplest form of encryption. The Caesar cipher shifts each letter by a fixed number of positions in the alphabet.

1 3 25
Ciphertext Output
KHOOR QHWZRUN
Each letter shifted by 3 positions
H → K, E → H, L → O, etc.

2. Symmetric Key Encryption

Uses a single shared secret key for both encryption and decryption. Fast and efficient for bulk data encryption in networks.

Fast & Efficient

Processes data ~1000x faster than asymmetric encryption. Ideal for large file transfers and real-time communication.

Single Key

One shared secret key for both operations. Key distribution is the main challenge—must be shared securely.

Common Use Cases

File encryption, VPNs, database protection, Wi-Fi security (WPA2/WPA3), and full-disk encryption.

AES Encryption Simulation

Advanced Encryption Standard (AES) is the most widely used symmetric cipher. It processes data in 128-bit blocks using substitution-permutation networks.

Result
Click Encrypt to see result...
Key Size
128-bit
Block Size
128-bit
Rounds
10

Common Symmetric Algorithms

Algorithm Key Size Block Size Status Use Case
AES 128/192/256-bit 128-bit Current Standard Wi-Fi, VPNs, File Encryption
3DES 168-bit 64-bit Legacy Legacy banking systems
DES 56-bit 64-bit Deprecated Historical only
ChaCha20 256-bit Stream Modern Mobile, TLS 1.3

3. Asymmetric (Public Key) Encryption

Uses a pair of mathematically related keys: public key for encryption, private key for decryption. Solves the key distribution problem.

How It Works

1

Key Generation

Each user generates a key pair: public key (shared openly) and private key (kept secret).

2

Encryption

Sender encrypts message using recipient's public key. Only recipient's private key can decrypt it.

3

Decryption

Recipient uses their private key to decrypt the message. No shared secret needed!

RSA Key Pair Visualization

PUBLIC KEY Share freely
(e=65537, n=0x9a3f7b2c...)
Used for: Encryption, Signature Verification
PRIVATE KEY Keep secret!
(d=0x4e8a2d91..., p=..., q=...)
Used for: Decryption, Digital Signing

Interactive RSA Message Exchange

A
Alice
Sender
Public Network
Waiting...
Intercepted Data:
[Encrypted - unreadable without private key]
B
Bob
Recipient
Decrypted Message:
...
Decrypted using Bob's Private Key

Symmetric vs Asymmetric Comparison

Feature Symmetric (AES) Asymmetric (RSA)
Keys Single shared key Public/Private key pair
Speed Fast (~GB/s) Slow (~KB/s)
Key Size 128-256 bits 2048-4096 bits
Best For Bulk data encryption Key exchange, signatures
Security Key distribution challenge No shared secret needed

Hybrid Approach: Modern systems (TLS/HTTPS) use both! Asymmetric encryption securely exchanges a symmetric session key, then symmetric encryption protects the actual data.

4. Cryptographic Hash Functions

One-way functions that convert data of any size to a fixed-size output. Essential for data integrity and digital signatures.

Key Properties

1

Deterministic

Same input always produces same output

2

One-Way

Computationally infeasible to reverse

3

Collision Resistant

Hard to find two inputs with same hash

4

Avalanche Effect

Small input change → drastically different output

Interactive Hash Demo

Hash Output (SHA-256):
2f0540fc... (simulated)

Notice: Try changing just one character in the input. The entire hash changes completely!

Digital Signatures: How They Work

1

Hash Message

Create hash of document

2

Sign Hash

Encrypt hash with private key

3

Send

Transmit message + signature

4

Verify

Decrypt with public key, compare hashes

Signature Verification Simulation

Pending

5. Real-World Applications in Computer Networks

How cryptography protects modern network communications.

HTTPS / TLS

Secures web traffic using hybrid encryption: asymmetric key exchange (RSA/ECC) establishes session, symmetric encryption (AES) protects data.

Port 443 X.509 Certs

VPNs (IPsec/SSL)

Virtual Private Networks use encryption tunnels. IPsec uses symmetric encryption (AES) with asymmetric key exchange via IKE.

AES-256 Tunnel Mode

Wi-Fi Security

WPA2/WPA3 use AES-CCMP or AES-GCMP for encryption. WPA3 adds Simultaneous Authentication of Equals (SAE) for better security.

WPA3 GCMP-256

Secure Email

PGP and S/MIME use asymmetric encryption for key exchange and digital signatures, symmetric for message content.

PGP S/MIME

Blockchain

Uses SHA-256 hashing to link blocks and ECDSA (Elliptic Curve) for digital signatures securing cryptocurrency transactions.

SHA-256 ECDSA

Digital Certificates

X.509 certificates bind public keys to identities using digital signatures from Certificate Authorities (CAs). Foundation of PKI.

X.509 PKI

Knowledge Check

Test your understanding of cryptographic concepts.

Ready to test your knowledge?

10 questions covering symmetric/asymmetric encryption, hashing, and network applications.