Key points
- Symmetric encryption uses one shared key; public-key encryption uses a linked pair.
- Hashes detect change; signatures prove who produced data.
- Certificates link public keys to identities.
- Key management and misuse cause more failures than broken mathematics.
Cryptography is the study of techniques that keep information secret, detect tampering and prove identity. It underpins secure web browsing, messaging, software updates and stored data. This page explains the main ideas at a conceptual level.
Encryption
Encryption turns readable data, called plaintext, into an unreadable form using a cipher and a key. Only someone with the right key can reverse it.
Symmetric encryption uses the same key to lock and unlock. It is fast and well suited to large amounts of data, but both parties must somehow share the key in advance without anyone else learning it.
Public-key encryption uses a pair of linked keys. One, the public key, can be shared with anyone and is used to lock data. The other, the private key, stays secret and is the only one that can unlock it. This solves the problem of sharing a secret over an open channel. In practice, systems combine both: public-key methods agree on a temporary symmetric key, and that key protects the bulk of the traffic.
Hashing
A hash algorithm turns any input into a short fixed-size fingerprint. The same input always gives the same fingerprint, a tiny change gives a very different one, and the process cannot practically be run backwards. Hashes are used to check that a file has not changed and to store passwords without keeping the passwords themselves. For passwords, deliberately slow hashing with a unique random value per account makes guessing expensive.
Digital signatures
A signature uses a private key to mark data so that anyone with the matching public key can verify who produced it and that it has not been altered since. Signatures protect software updates, documents and messages.
Certificates
A certificate binds a public key to an identity, such as a website's name, and is itself signed by a trusted authority. When a browser connects securely, it checks the certificate to confirm that it is talking to the genuine site. Trust therefore depends on the authorities being careful and on certificates being renewed and revoked correctly. See network security for how this protects data in transit.
Why key management is hard
The mathematics is rarely the weak point. Keys must be generated well, stored safely, shared only with the right parties, rotated on a schedule and destroyed when no longer needed. A key left in source code, copied into an email or kept on a shared drive undoes the protection. Recovery matters too: lose the only key and the data is gone for good. Dedicated hardware and managed key services exist to reduce these risks.
Common misuse
- Home-grown schemes. Inventing a private method is a classic mistake. Well-reviewed, widely used designs should always be preferred.
- Weak randomness. Keys and tokens drawn from predictable sources can be guessed. Use the secure random generator the platform provides.
- Reused keys. Using one key for many purposes, or one value where a fresh one is required, can leak information.
- Encryption without integrity. Hiding data is not the same as preventing its change.
Related topics include application security, where these mistakes often appear, and the glossary.