The fundamentals · free and interactive

Encryption is not magic.

It is a small set of ideas about messages, locks, fingerprints, and who holds the keys. Learn those ideas by changing real data and watching what happens.

01 · DEVICE APLAINTEXTkey stays here
PROTECTVOF3
02 · SERVICECIPHERTEXTstore / relay only
VOF3OPEN
03 · DEVICE BPLAINTEXTmatching key here
KEY Akeys exist only at readable endpointsKEY A
01 / DATA

A computer sees numbers.

You see letters, images, and sound. A computer stores all of them as bytes: small numbers from 0 to 255. A shared rule such as UTF-8 says which numbers represent which characters.

TEXThello
UTF-8 · HEX68 65 6c 6c 6f
UTF-8 · DECIMAL104 101 108 108 111
BYTE COUNT5
Think of it like sheet music.

The page is not the sound. It is a precise representation that another musician can turn back into the same sound. Bytes are the computer’s notation.

02 / THREE DIFFERENT JOBS

Same message. Different purpose.

Encoding, hashing, and encryption are often grouped together because their outputs look unfamiliar. They solve completely different problems.

ENCODINGChange the representation

Like rewriting the same address in a different alphabet. Anyone who knows the format can reverse it. No secret required.

BASE64
Readable by anyone.
HASHINGMake a fingerprint

Like a receipt for the exact message. Tiny changes produce a different fingerprint. The receipt does not contain the original.

SHA-256
One-way comparison
ENCRYPTIONControl who can read it

Like placing the message in a locked box. The output is unreadable until the correct key opens it.

EPHEMERAL 256-BIT KEYGenerating locally…
REAL XCHACHA20-POLY1305Encrypting locally…
The key and complete encrypted result are shown because this is a teaching lab.
ENCODINGcompatibilityHASHINGcomparisonENCRYPTIONconfidentiality
03 / KEYS

The algorithm can be public. The key cannot.

Good encryption does not depend on hiding how the lock works. Everyone may inspect the lock. Security comes from the key being unpredictable and held by the right person.

ALICE
KEY A
MESSAGEOPEN
BOB
KEY A

Symmetric encryption uses the same secret key to lock and unlock. It is fast, but both sides need a safe way to get that secret.

Public does not mean powerless.

A public key is designed to be shared. A private key is designed never to be shared. The two have different jobs.

04 / END TO END

Put the keys at the ends.

End-to-end encryption means readable data exists at the communicating endpoints, but the systems carrying or storing it do not receive the key needed to read it.

ALICE’S DEVICEREADABLEholds a key
MESSAGE
SERVICECIPHERTEXT ONLYmoves and stores the locked box
BOB’S DEVICEWAITINGholds a key
SERVER RECEIVESCIPHERTEXT
SERVER MAY STORETHE SAME CIPHERTEXT
SERVER MUST NOTREQUEST OR LOG THE KEY

Alice protects the message before it leaves her device.

E2EE does not mean “nothing can ever go wrong.”

If an endpoint is compromised while the message is readable, encryption cannot make that endpoint trustworthy. It protects the path and storage boundary between trusted ends.

05 / INTEGRITY

A locked box needs a seal.

Confidentiality hides the contents. Integrity tells you whether the protected data was changed. Modern authenticated encryption provides both.

MESSAGETransfer 10 creditsKEYGenerating locally…
VOF3 ARTIFACT · HEXProtecting locally…
No byte changed.
GENERATING SEAL
Generating an authenticated artifact locally.
A broken seal is not repaired.

The safe result is failure—not a best guess at what the message might have been.

06 / HUMAN SECRETS

A password is not automatically a key.

People create memorable passwords. Cryptography wants uniformly shaped key material. A key-derivation function combines a password, a random salt, and deliberate work to bridge that gap.

PASSWORDcorrect horse
+
RANDOM SALT
+
WORK50,000
DERIVED KEYDeriving automatically…
Every change derives again locally.
DERIVATION HISTORYSame inputs produce the same output.
    Salt is not another password.

    It may be stored beside the derivation record. Its job is to make identical passwords take different paths and defeat precomputed lookup tables. The work factor makes each guess cost more.

    07 / RECOVERY

    Recover the keys, not every file.

    A well-designed system separates the recovery credential from the stable root, application keys, and data keys. Changing recovery should change the wrapper—not the identity of everything underneath.

    RECOVERY CREDENTIAL
    derives
    WRAPPER 01 · ACTIVE
    unwraps
    STABLE ROOT
    NOTES KEY
    PHOTOS KEY
    MESSAGES KEY

    Ready. The stable root and application keys do not need to change.

    One rootstable account continuity
    Separate app keysone app does not become every app
    Many data keysrotation and deletion stay narrow
    08 / THE REAL BOUNDARY

    Encryption protects data—not every mistake.

    A strong lock does not help if someone photographs the open document, steals the key, or convinces the owner to open the door. Security is the whole path around the primitive.

    01

    Compromised endpoints

    Readable data and usable keys exist somewhere. Malware at that endpoint may observe them.

    02

    Logs and analytics

    Plaintext copied into telemetry is outside the protection of the encrypted artifact.

    03

    Metadata

    Encryption may hide content while timing, size, participants, or access patterns remain visible.

    04

    Authorization

    Cryptography can prove integrity. Your application still decides who is allowed to perform an action.

    05

    Screenshots and cameras

    Once information is shown to a person, the physical environment becomes part of the threat model.

    06

    Recovery custody

    A recovery secret deserves the same care as the keys it can restore.

    09 / PUT IT TOGETHER

    Trace the whole custody boundary.

    Readable data begins at an endpoint. A local key protects it. The service receives one authenticated artifact. The matching endpoint opens it. Every stage below exposes exactly what exists there.

    01 · ENDPOINT AREADABLE + KEY
    protect
    02 · SERVICEAUTHENTICATED ARTIFACTProtecting locally…
    open
    03 · ENDPOINT BREADABLE AFTER AUTHWaiting…
    EPHEMERAL KEY USED BY THIS LABGenerating locally…
    Running the complete local round trip…

    The service column never receives the key or plaintext in the end-to-end model.

    Knowledge check

    Four claims.
    What is true?

    Answer all four. The trace closes only when every boundary is correct.

    0 / 4

    Four boundaries left to verify.

    Base64 encoding keeps a secret from anyone without a key.

    Choose an answer.

    A tiny message change should produce a different cryptographic hash.

    Choose an answer.

    In E2EE, the service can carry ciphertext without holding the key that reads it.

    Choose an answer.

    Rotating a recovery credential should require re-encrypting every file.

    Choose an answer.
    Next layer

    You know the vocabulary.
    Now use the library.

    Type a concept or API name.