JUMP TO SECTIONChoose a lesson section
Learn what each cryptographic tool actually does.
It is tempting to treat encryption, hashes, signatures and certificates as interchangeable. They're not. Each addresses a different problem, and real systems combine them.
Privacy, integrity and identity are different promises.
Confidentiality
Authorized parties with the correct key can recover plaintext. Modern authenticated encryption also detects tampering.
AES-GCM protects data at rest or in transit.Fingerprint / integrity aid
A digest of input data. It is not reversible encryption and, by itself, does not prove who supplied the data.
SHA-256 hashes a downloaded file.Shared-key authenticity + integrity
A secret key and message produce an authentication tag that someone holding the key can verify.
HMAC-SHA-256 authenticates a message.Public-key authenticity + integrity
A private key signs; the corresponding public key verifies. The signature does not hide the message.
A CA signs an X.509 certificate.Base64 changes representation so bytes can travel through text-oriented systems. Anyone can reverse it without a secret. Compression is also not cryptographic protection.
Likewise, an unkeyed hash can detect an accidental change when you compare it against a trusted expected digest, but an attacker capable of replacing both the file and digest can supply a matching malicious pair. Authentication requires an additional trust mechanism.
The algorithm matters. So does the key's job.
One shared secret
The same secret key is used to encrypt and decrypt. It's efficient for bulk data but both parties must obtain and protect the key.
AES-128-GCM / AES-256-GCMA public/private pair
The private key stays controlled by the owner; the public key can be distributed. Different algorithms support signatures, key agreement, or encryption—don't assume every key pair does all three.
RSA signatures · ECDSA signaturesDerive a fresh shared secret
With ECDHE, each peer contributes an ephemeral key pair. They derive matching shared material without sending the final symmetric key across the wire.
X25519 · NIST P-256 ECDHEIn a typical TLS connection, certificates help authenticate the server, ephemeral Diffie–Hellman derives shared key material, and symmetric authenticated encryption protects application traffic. These are complementary roles—not competing ways to encrypt everything.
With properly implemented ephemeral (EC)DHE, later compromise of the server's long-term certificate private key does not by itself recover past recorded session keys. It does not prevent an attacker holding the key from impersonating the server during a future connection.
Not all “random values” do the same job.
| Concept | Purpose | Common misconception |
|---|---|---|
| Hash / digest | Fixed-size digest of input data, e.g. SHA-256 | Not encryption or identity proof by itself |
| Password salt | Make password hashes distinct per account, frustrating precomputation | Usually public; not an encryption key |
| IV / nonce | Initialize/differentiate encryption operations as required by the mode | Not interchangeable with a salt; uniqueness rules matter |
| HMAC | Shared-secret authentication and integrity | Doesn't encrypt or create public verification |
| Signature | Verifiable with public key; signed with private key | Doesn't hide the signed content |
For passwords, prefer a deliberately costly password hashing scheme such as Argon2id, configured and tuned for your environment. Fast general-purpose SHA-256 alone lets attackers attempt guesses far too efficiently. For encrypted application data, prefer vetted authenticated-encryption implementations such as AES-GCM, with correctly managed nonces.
A certificate binds an identity to a public key.
An X.509 certificate is a signed statement containing a public key and identifying information, issued under a Certificate Authority's (CA's) policies. A server controls the corresponding private key; a client validates the certificate's identity and chain.
The DNS name the client requests must match a permitted SAN. Don't rely on a friendly Common Name to override an incorrect SAN.
The certificate must be valid at the relevant verification time. Check the client's clock when diagnosing validity errors.
The issuer signs the certificate. Each intermediate must be authorized as a CA and chain to a trusted anchor.
Extensions such as serverAuth constrain how a certificate can be used. Clients apply purpose and policy checks.
In a common public web PKI, the chain looks like leaf → issuing intermediate → trusted root. The root is trusted because it is in the client's trust store or configured trust anchors—not because the web server sends it. Servers generally present the leaf and necessary intermediates; a client may be able to retrieve a missing intermediate, but administrators should not rely on that behavior.
Revocation may be checked through CRLs or OCSP where supported and enforced. Whether a revocation lookup failure blocks a connection depends on the client, browser, platform and policy. Don't claim that a valid chain always guarantees live revocation was checked.
Break the trust chain—and find out why it fails.
Pick a common incident or change the client checks manually. Watch the chain evaluation react to incorrect hostnames, missing intermediates, untrusted roots, expired certificates, or inappropriate key usage.
How a browser gets from Hello to HTTPS.
The handshake negotiates algorithms, authenticates a peer, and establishes protected traffic keys. This simplified timeline describes a common certificate-authenticated TLS 1.3 handshake with ephemeral key agreement, not every extension, resumption mode or client-authenticated variant.
ClientHello
The client offers supported TLS versions, algorithms, random data and a key-share for ephemeral agreement (among other extensions).
ServerHello + key agreement
The server selects compatible parameters and supplies its key-share. Both parties derive handshake secrets from the agreed shared material.
Certificate + authentication
The server presents its certificate chain and proves possession of the certified private key with CertificateVerify. The client checks the certificate path, name and policy.
Finished + application data
Both sides verify Finished messages, then exchange application data using derived symmetric authenticated-encryption keys. The server's public key did not encrypt every HTTP byte.
Valid HTTPS can protect a connection to a malicious website. Certificates establish certain identity and key relationships under a trust model; they do not make everything behind the domain trustworthy.
A secure fix starts with evidence.
Suppose several managed clients report “certificate chain incomplete” for an internal application after a web-server update, while others appear unaffected. Start by separating network reachability from TLS identity validation—then inspect what the server actually presents.
openssl s_client -connect app.example.test:443 -servername app.example.test -showcerts openssl x509 -in server.pem -noout -subject -issuer -dates -ext subjectAltName # On Windows: inspect the certificate and chain using the OS certificate UI # PowerShell network test checks TCP reachability, not certificate trust: Test-NetConnection app.example.test -Port 443
Interpretation: Check the requested hostname (SNI), leaf SAN, dates, issuer, delivered intermediate(s), trust anchor, key usage and client-specific policy. An open TCP port only proves transport reachability; it does not prove the TLS handshake validates successfully.
Do not turn off TLS verification, deploy a random root certificate to every workstation, or bypass errors with unencrypted HTTP. Repair the server chain or certificate identity with an approved change, then verify from affected and unaffected client environments.
What changes when classical algorithms face quantum risk?
Large fault-tolerant quantum computers could weaken widely used classical public-key schemes such as RSA and ECC. NIST standardized ML-KEM for key establishment and ML-DSA and SLH-DSA for digital signatures in 2024. Transitioning real systems requires inventory, platform support, interoperability planning, and cryptographic agility—not simply replacing an AES key with a “quantum certificate.”
For your fundamentals, remember the roles: key establishment, signatures, bulk symmetric encryption, hashing and certificate trust. New algorithms may replace individual roles, while the need to authenticate and manage trust remains.
Can you explain the distinction?
01Does SHA-256 'encrypt' a password?
No. SHA-256 is a fast digest algorithm. Password storage needs a deliberately slow, salted password-hashing/KDF scheme such as Argon2id (or suitable alternatives), not plain SHA-256.
02Are a salt and an IV the same thing?
No. A salt commonly differentiates password-hash inputs and defeats precomputation. An IV/nonce supplies per-operation uniqueness or initialization to an encryption mode; its requirements depend on the mode. Reusing an AES-GCM nonce with the same key can catastrophically undermine security.
03Does a certificate prove that a website is safe to use?
No. A valid certificate can establish that the holder controls the key for the asserted identity (under the CA's validation process). It does not certify that the site's content, business, or software is trustworthy.
04Why don't we trust every certificate a server sends?
An attacker could generate a key pair and self-signed certificate. Clients validate a chain to a trust anchor configured in their trusted store, plus applicable naming and usage checks.
05Is an expired leaf always fixed by renewing the root CA?
No. Determine which certificate is expired. A normal leaf expiration generally requires renewing/replacing the leaf; a missing intermediate requires correct intermediate delivery; a wrong hostname requires a certificate with the right SAN.
06Does TLS 1.3 simply encrypt everything using the website certificate's RSA public key?
No. Modern TLS 1.3 commonly uses (EC)DHE for ephemeral shared secret establishment, certificates/signatures for peer authentication, and symmetric AEAD for application data. The certificate is not the bulk encryption key.
Check the standards, not just the slogans.
Teaching models intentionally omit protocol details. Use current platform documentation and approved change procedures when repairing production TLS or PKI systems.
