Skip to main content
LEARN / CYBERSECURITY / FUNDAMENTALS

The secret isn't
just the key.

Encryption protects information, but how do we know whom to trust? Explore hashes, keys, digital signatures, certificates, and the handshake that helps secure modern web connections.

Foundational → IntermediateWritten + InteractiveSecurity+ · PKI · TLS
Start the lesson 01 / Learn 02 / Practice
START HERE / THE OBJECTIVES

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.

01Choose between encryption, hashing, MACs and signatures based on the security goal.
02Explain how symmetric keys, public/private key pairs and ephemeral key exchange differ.
03Trace a certificate chain from a website's leaf certificate through intermediates to a trusted root.
04Diagnose common TLS trust failures without bypassing certificate validation.
01 / THE SECURITY GOALS

Privacy, integrity and identity are different promises.

ENCRYPTION

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.
HASHING

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.
MAC / HMAC

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.
DIGITAL SIGNATURE

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.
Encoding isn't encryption.

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.

02 / KEYS AND KEY AGREEMENT

The algorithm matters. So does the key's job.

01
SYMMETRIC ENCRYPTION

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-GCM
02
ASYMMETRIC KEYS

A 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 signatures
03
KEY AGREEMENT

Derive 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 ECDHE

In 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.

Forward secrecy

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.

03 / HASHES, SALTS AND NONCES

Not all “random values” do the same job.

ConceptPurposeCommon misconception
Hash / digestFixed-size digest of input data, e.g. SHA-256Not encryption or identity proof by itself
Password saltMake password hashes distinct per account, frustrating precomputationUsually public; not an encryption key
IV / nonceInitialize/differentiate encryption operations as required by the modeNot interchangeable with a salt; uniqueness rules matter
HMACShared-secret authentication and integrityDoesn't encrypt or create public verification
SignatureVerifiable with public key; signed with private keyDoesn'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.

04 / X.509 CERTIFICATES & PUBLIC-KEY INFRASTRUCTURE

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.

SUBJECT ALT NAME (SAN)Hostname identity

The DNS name the client requests must match a permitted SAN. Don't rely on a friendly Common Name to override an incorrect SAN.

NOT BEFORE / NOT AFTERValidity period

The certificate must be valid at the relevant verification time. Check the client's clock when diagnosing validity errors.

ISSUER / SIGNATUREChain integrity

The issuer signs the certificate. Each intermediate must be authorized as a CA and chain to a trusted anchor.

KEY USAGE / EKUPermitted purpose

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.

05 / INTERACTIVE CERTIFICATE VALIDATION

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.

TLS / TRUST PATH INSPECTORSIMULATED CLIENT · REQUESTED HOST: app.example.test
LOCAL TRAINING MODEL
01 / LEAF CERTIFICATEapp.example.testServer · presented certificate
02 / INTERMEDIATE CAExample Issuing CAAvailable for path construction
03 / TRUST ANCHORExample Trusted RootTrusted in this client's store
Client validation conditionsChange any condition to see the result
CERTIFICATE VALIDATION PASSEDIdentity path accepted in this model

All required checks pass in this simplified model.

CHECK RESULTS
✓

Leaf SAN matches app.example.test

✓

Leaf and intermediates are within validity periods

✓

Issuing intermediate available and chain signatures/linkage are valid

✓

Chain terminates at an authorized client trust anchor

✓

Server authentication usage and required constraints are satisfied

Educational abstraction only. No certificate is fetched and no TLS handshake or real cryptography runs. Real clients also validate signatures, CA constraints, policies, chain building and sometimes revocation; a passing certificate check alone does not prove a completed secure connection.

06 / TLS 1.3 HANDSHAKE

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.

01

ClientHello

The client offers supported TLS versions, algorithms, random data and a key-share for ephemeral agreement (among other extensions).

02

ServerHello + key agreement

The server selects compatible parameters and supplies its key-share. Both parties derive handshake secrets from the agreed shared material.

03

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.

04

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.

Don't confuse server identity with content safety.

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.

07 / TROUBLESHOOTING PKI IN THE FIELD

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.

ILLUSTRATIVE / INSPECT ONLY · USE AN AUTHORIZED ENDPOINT
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.

Avoid the tempting shortcuts.

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.

08 / POST-QUANTUM CONTEXT

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.

09 / CONCEPT CHECK

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.

REFERENCE MATERIAL

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.

YOUR NEXT STEP / OPTIONAL PRACTICE

Trust the evidence. Not the padlock.

Practice choosing cryptographic tools, tracing certificate path validation and diagnosing why a TLS connection fails.

Launch Practice 006 →
NEXT REQUIRED STEP · ENCRYPTION, PKI & TLS

Complete the Practice milestone

You've reached the end of this written lesson. Your next step is practice—complete Encryption & PKI · Module 006 before proceeding to a new lesson. This is milestone 2 of 3. You can revisit the explanation whenever you need it.