Cryptography Basics

Cryptography is the science of securing information by transforming it into an unreadable format, called ciphertext, which can only be decoded with a key. It protects data privacy, integrity, and authenticity in digital communication. From ancient ciphers to modern encryption, cryptography ensures secrets stay safe. This article introduces its history, types, math, and uses.

Brief History

Cryptography dates back to ancient times:

  • Caesar Cipher (50 BCE): Julius Caesar shifted letters (e.g., A → D).
  • Enigma (WWII): Germans used rotor machines for complex substitution.
  • Public-Key (1970s): Diffie-Hellman and RSA revolutionized modern crypto.

Today, it underpins internet security.

Types of Cryptography

Cryptography splits into two main categories:

  • Symmetric: Same key for encryption and decryption (e.g., AES).
  • Asymmetric: Public/private key pair (e.g., RSA).

Hash functions (e.g., SHA-256) also secure data by producing fixed-length outputs, though they’re one-way.

Mathematical Foundations

Cryptography relies on math:

  • Modular Arithmetic: \( a \mod n \) underpins many algorithms (e.g., \( 17 \mod 5 = 2 \)).
  • Prime Numbers: RSA uses large primes for key generation.
  • Discrete Logarithms: Basis for Diffie-Hellman key exchange.

Example: \( 2^{10} \mod 11 = 1024 \mod 11 = 1 \), showing cyclic behavior.

Applications

Cryptography secures:

  • Communication: HTTPS encrypts web traffic.
  • Finance: Protects online banking with SSL/TLS.
  • Identity: Digital signatures verify authenticity.

It’s vital for privacy and trust in the digital age.