L03: Cryptographic Foundations

Experience hash functions, the avalanche effect, and public-key cryptography using interactive tools.

View Lesson Slides (PDF)

SHA-256 Hash Demo

Anders Brownworth's SHA-256 Hash Demo — type anything and see its hash instantly

Guided Activities

1

Hash Functions Hands-On

Anders Brownworth Hash — Embed
  1. In the embedded hash demo above, type "Hello" and observe the SHA-256 hash.
  2. Now change it to "hello" (lowercase h). Notice the entire hash changes completely!
  3. This is called the "avalanche effect" — a tiny input change produces a completely different hash.
  4. Try typing your name. Now add a single space at the end. Compare the two hashes.
  5. Try to predict: will "Alice" and "Bob" produce similar hashes? Test it!
Discussion: Why is the avalanche effect critical for blockchain security? What would happen if similar inputs produced similar hashes?
2

SHA-256 Calculator

emn178 — Link
  1. Go to emn178.github.io/online-tools/sha256.html
  2. Type "Bitcoin" and note the resulting hash.
  3. Now type "bitcoin" (lowercase b). How many characters of the hash are different?
  4. Hash an empty string (clear the input). What result do you get? (This is a well-known constant!)
  5. Try hashing a very long paragraph of text. Is the output still the same 64-character length?
Discussion: Can you find two different inputs that produce the same SHA-256 hash? Why is this practically impossible?
3

Crypto Operations in CyberChef

GCHQ CyberChef — Link
  1. Go to gchq.github.io/CyberChef/ (this is a tool built by UK's intelligence agency GCHQ)
  2. In the "Operations" panel on the left, search for "SHA-256" and drag it to the "Recipe" area.
  3. Type "Cryptoeconomics" in the "Input" box. The hash appears instantly in the "Output" box.
  4. Copy the hash output.
  5. Now search for "To Base64" in Operations and drag it AFTER the SHA-256 step in your Recipe. Notice how the output changes — this is encoding, not hashing.
Discussion: What is the fundamental difference between hashing and encoding? Can you reverse a hash? Can you reverse an encoding?
4

Generate a Bitcoin Key Pair

bitaddress.org — Link
  1. Go to bitaddress.org (this tool runs entirely client-side in your browser — no data is sent to any server).
  2. Move your mouse randomly across the screen to generate cryptographic entropy (randomness).
  3. Once complete, observe the generated: Private Key (WIF format), Public Key, and Bitcoin Address.
  4. Notice: the private key is 256 bits (64 hex characters), but the Bitcoin address is much shorter.
  5. WARNING: Do NOT use these generated keys for real funds — this is for educational purposes only.
Discussion: Why can you derive the Bitcoin address from the private key, but NOT derive the private key from the Bitcoin address? What mathematical concept makes this possible?

Alternative Tool

  • If bitaddress.org triggers a browser security warning, try iancoleman.io/bip39 as an alternative for BIP-39 mnemonic and key generation.
© Joerg Osterrieder 2025-2026. All rights reserved.