Modern cryptography provides the technical backbone for protecting data at rest and in transit, and it comes in two main flavors. Symmetric encryption uses a single shared key to both encrypt and decrypt, making it fast and suitable for bulk data. Common symmetric algorithms include AES (the current standard), 3DES (legacy and being phased out), and ChaCha20. Asymmetric encryption, by contrast, uses a mathematically linked public and private key pair: the public key encrypts or verifies signatures, and the private key decrypts or creates them. RSA, the most widely used asymmetric algorithm, secures communication, creates digital signatures, and performs key exchange based on the difficulty of factoring large primes. ECC (Elliptic Curve Cryptography) offers equivalent security to RSA with much smaller key sizes, making it popular in mobile and IoT environments. DSA is another asymmetric algorithm used primarily for signatures.
Digital signatures are a key application of asymmetric cryptography. To sign a message, the sender hashes it and encrypts the hash with their private key; the recipient verifies by decrypting with the sender's public key and comparing hashes. This proves both the sender's identity and the message's integrity. Public keys are distributed through digital certificates, which are signed and issued by a Certificate Authority (CA). The standard format for these certificates is X.509, used throughout PKI and TLS. Certificates vary in scope: a self-signed certificate is signed by the entity itself and is not trusted by default in browsers unless manually added, while a wildcard certificate secures a domain and all of its first-level subdomains, written as *.example.com. Applications can also use certificate pinning to hardcode a specific certificate or public key, detecting fraudulent certificates even when they are technically valid. To handle compromised certificates, CAs publish Certificate Revocation Lists (CRLs) and offer real-time lookups via the Online Certificate Status Protocol (OCSP).
All of these components together form a Public Key Infrastructure (PKI), the framework of policies, hardware, software, and people used to manage certificates and keys. Special components protect keys themselves: key escrow stores a copy of a key with a trusted third party for recovery, hardware security modules (HSMs) are tamper-resistant devices that generate, store, and manage keys, and a Trusted Platform Module (TPM) is a chip on the motherboard that stores keys and supports platform integrity measurements. Full-disk encryption (FDE), such as BitLocker or FileVault, encrypts entire storage devices so all data is unreadable without the proper key at boot. Block cipher modes of operation, such as CBC, GCM, and CTR, define how a block cipher is applied to data longer than a single block; AES-GCM is an authenticated encryption mode that provides both confidentiality and integrity in a single operation. Message Authentication Codes (MACs) and the more common HMAC (Hash-based MAC) verify both integrity and authenticity using a shared secret key.
Two parties who have never met still need a way to establish a shared secret, which is the job of key exchange protocols. Diffie-Hellman allows two parties to derive a shared secret over an insecure channel, even though an eavesdropper observes every message; RSA can also be used for key exchange, but as an encryption and signature algorithm rather than a dedicated key-agreement scheme. ECDH applies the same idea over elliptic curves. Modern protocols also aim for perfect forward secrecy (PFS), a property where session keys are ephemeral, so that compromising one long-term private key cannot decrypt previously recorded sessions. Combined with hashing, signature schemes, and certificate infrastructure, these primitives underpin nearly every secure communication protocol in use today.