Two pieces of cryptography do almost all the work in Bitcoin: hash functions and digital signatures. Neither is encryption; nothing on the chain is hidden.
Hashes
A hash function turns any input into a fixed-size fingerprint. Bitcoin uses SHA-256, which produces 256 bits (64 hex characters). Change one character of the input and the whole output changes. You cannot work backwards from a hash to its input. Hashes give every transaction and block an ID, link blocks together, and set the mining puzzle.
Keys
A private key is a random 256-bit number. From it, elliptic-curve math (the curve is called secp256k1) produces a public key. The step is one-way: easy forward, infeasible backward. An address is a hashed, encoded form of the public key.
Signatures
When you spend an output, your wallet signs the transaction with the private key. The signature is specific to that exact transaction: change one byte and it fails. Anyone can verify the signature using only the public key, which is why nodes can check your payment without knowing your key. Bitcoin used ECDSA from the start and added Schnorr signatures with Taproot in 2021.
Locks
Each output carries a small script, the locking script, that says how it may be spent. The common one says "whoever provides a signature matching this public key hash". Other scripts require several signatures, or a timelock, or a secret. Script is deliberately simple so nodes can always evaluate it quickly and predictably.
Tap a card to flip it.