Cryptography Fundamentals

Cryptography is the science of securing information by transforming it into ciphertext, unreadable without a key, ensuring privacy, integrity, and authenticity in digital communication. From ancient ciphers to modern encryption, it safeguards sensitive data across various domains. This MathMultiverse guide introduces cryptography’s history, types, mathematical foundations, and applications, enriched with examples and equations.

History of Cryptography

Cryptography has evolved over centuries:

  • Caesar Cipher (50 BCE): A substitution cipher shifting letters (e.g., A → D).
  • Enigma Machine (WWII): Used rotors for complex encryption, broken by Allied cryptographers.
  • Public-Key Cryptography (1970s): Diffie-Hellman and RSA introduced secure key exchange over insecure channels.

Modern cryptography powers secure internet protocols.

\[ \text{Caesar Cipher: } E(x) = (x + k) \mod 26, \quad D(y) = (y - k) \mod 26 \]

Types of Cryptography

Cryptography is divided into key categories:

  • Symmetric Cryptography: Uses the same key for encryption and decryption (e.g., AES).
  • Asymmetric Cryptography: Employs a public/private key pair (e.g., RSA).
  • Hash Functions: Produces fixed-length outputs for data integrity (e.g., SHA-256).

Symmetric is fast but requires secure key sharing; asymmetric solves this but is slower.

\[ \text{AES Encryption: } C = E_k(P), \quad P = D_k(C), \quad \text{same key } k \]

Mathematical Foundations

Cryptography relies on mathematical principles:

  • Modular Arithmetic: Core to many algorithms, e.g., \( a \mod n \).
  • Prime Numbers: RSA uses large primes for secure key generation.
  • Discrete Logarithms: Underpin Diffie-Hellman key exchange.

Example: RSA key generation involves choosing primes \( p, q \), computing \( n = p \cdot q \), and finding \( e, d \) such that:

\[ e \cdot d \equiv 1 \mod \phi(n), \quad \phi(n) = (p-1)(q-1) \]

For Diffie-Hellman, key exchange uses:

\[ K = g^{ab} \mod p, \quad \text{where } g \text{ is a generator, } p \text{ is prime} \]

Applications

Cryptography secures critical systems:

  • Communication: HTTPS uses TLS for encrypted web traffic.
  • Finance: Protects transactions via secure protocols.
  • Identity: Digital signatures ensure authenticity.

It’s essential for privacy and trust in digital ecosystems.

\[ \text{Digital Signature: } \text{Sign}(m) = m^d \mod n, \quad \text{Verify}(m, s) = s^e \equiv m \mod n \]