{"id":51578768,"url":"https://github.com/systemslibrarian/crypto-lab-hash-zoo","last_synced_at":"2026-07-11T03:32:25.780Z","repository":{"id":367851423,"uuid":"1204605209","full_name":"systemslibrarian/crypto-lab-hash-zoo","owner":"systemslibrarian","description":"Browser-based SHA-256 vs SHA3-256 vs BLAKE3 internals — live avalanche analysis, Merkle-Damgård/sponge/tree construction diagrams, and timing benchmarks. Part of crypto-lab.","archived":false,"fork":false,"pushed_at":"2026-06-28T02:03:41.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T02:18:37.738Z","etag":null,"topics":["avalanche-effect","blake3","browser-demo","crypto-lab","cryptography-education","hash-functions","keccak","length-extension-attack","merkle-damgard","sha256","sha3"],"latest_commit_sha":null,"homepage":"https://systemslibrarian.github.io/crypto-lab-hash-zoo/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemslibrarian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-08T06:49:28.000Z","updated_at":"2026-06-28T02:03:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-hash-zoo","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-hash-zoo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-hash-zoo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-hash-zoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-hash-zoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-hash-zoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-hash-zoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-hash-zoo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-hash-zoo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35350133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avalanche-effect","blake3","browser-demo","crypto-lab","cryptography-education","hash-functions","keccak","length-extension-attack","merkle-damgard","sha256","sha3"],"created_at":"2026-07-11T03:32:25.191Z","updated_at":"2026-07-11T03:32:25.773Z","avatar_url":"https://github.com/systemslibrarian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-lab-hash-zoo\n\n## What It Is\n\nHash Zoo is an interactive side-by-side comparison of three cryptographic hash functions: SHA-256 (Merkle-Damgård construction via `@noble/hashes/sha2`), SHA3-256 (Keccak sponge construction via `@noble/hashes/sha3`), and BLAKE3 (binary tree hash via `@noble/hashes/blake3`). It computes 256-bit digests, measures timing across 100 iterations, and visualizes the avalanche effect — how flipping a single input bit changes roughly half the output bits. The demo also shows SHA-256 Merkle-Damgård padding and SHA-3 rate/capacity parameters to illustrate the structural differences between constructions.\n\n## When to Use It\n\n- **Learning hash function internals.** The avalanche grid and construction diagrams make abstract concepts like sponge absorption and tree-parallel hashing concrete.\n- **Comparing performance characteristics.** The timed hash table shows relative throughput of SHA-256, SHA3-256, and BLAKE3 on identical input in the browser.\n- **Understanding construction trade-offs.** Side-by-side architecture diagrams clarify why SHA-3 resists length extension while bare Merkle-Damgård does not.\n- **Teaching or presenting cryptography.** The live controls (message textarea, bit-position slider) make this suitable for classroom or conference demos.\n- **Not for password hashing.** None of these hash functions are memory-hard; use Argon2id or similar KDFs for password storage.\n- Do NOT use this as a crypto library — it is a browser teaching demo for comparing hash constructions.\n\n## Live Demo\n\n**[systemslibrarian.github.io/crypto-lab-hash-zoo](https://systemslibrarian.github.io/crypto-lab-hash-zoo/)**\n\nType or paste any message into the textarea and click \"Hash All Three\" to see hex output, average timing, and construction metadata for all three algorithms. Use the bit-position slider in Section B to flip a single bit and watch the 16×16 avalanche grid animate which output bits changed. Click \"Padding info\" to inspect the SHA-256 padded block and SHA-3 rate/capacity split.\n\n## What Can Go Wrong\n\n- **Length extension on bare SHA-256.** Merkle-Damgård hashes expose their internal state as the final digest, allowing an attacker to append data and compute a valid hash without knowing the original message. Use HMAC-SHA256 or switch to SHA-3/BLAKE3.\n- **Confusing hash speed with password safety.** SHA-256, SHA3-256, and BLAKE3 are all fast hashes — unsuitable for password storage because an attacker can brute-force billions of guesses per second.\n- **Assuming SHA-256 and SHA3-256 are interchangeable.** Despite both producing 256-bit output, their constructions differ fundamentally. Code expecting Merkle-Damgård padding semantics will break if swapped to a sponge hash.\n- **Ignoring BLAKE3's tree structure in streaming contexts.** BLAKE3 digests depend on chunk boundaries; streaming implementations must track the tree state correctly or produce wrong hashes.\n- **Timing side channels in comparison logic.** Comparing hash digests with early-exit equality checks can leak information about which bytes match; use constant-time comparison in security-critical code.\n\n## Real-World Usage\n\n- **Bitcoin and cryptocurrency.** Bitcoin uses double-SHA-256 for block headers and transaction IDs, relying on Merkle-Damgård's collision resistance.\n- **NIST standards and TLS.** SHA-256 is mandated in TLS 1.3 certificate signatures, DNSSEC, and many federal compliance frameworks (FIPS 180-4).\n- **Ethereum 2.0 consensus.** The beacon chain uses SHA-256 for its Merkle tree commitments in the proof-of-stake protocol.\n- **NIST SHA-3 standard (FIPS 202).** SHA3-256 is standardized as a structural alternative to SHA-2, adopted in protocols requiring sponge-based security guarantees.\n- **BLAKE3 file integrity.** The `b3sum` tool and Bao verified streaming use BLAKE3 for fast, parallelizable file checksums and integrity verification.\n\n## How to Run Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-hash-zoo\ncd crypto-lab-hash-zoo\nnpm install\nnpm run dev\n```\n\n## Related Demos\n\n- [crypto-lab-babel-hash](https://systemslibrarian.github.io/crypto-lab-babel-hash/) — SHA-256, SHA3-256, BLAKE3, and HMAC in one comparison.\n- [crypto-lab-merkle-vault](https://systemslibrarian.github.io/crypto-lab-merkle-vault/) — Merkle trees and inclusion proofs built on SHA-256.\n- [crypto-lab-collision-vault](https://systemslibrarian.github.io/crypto-lab-collision-vault/) — MD5/SHA-1 collisions and what breaks when collision resistance fails.\n- [crypto-lab-mac-race](https://systemslibrarian.github.io/crypto-lab-mac-race/) — HMAC, CMAC, Poly1305, and GHASH message authentication.\n- [crypto-lab-kdf-chain](https://systemslibrarian.github.io/crypto-lab-kdf-chain/) — HKDF, PBKDF2, scrypt, and Argon2id, the memory-hard KDFs hashes should not replace.\n\n---\n\n*One of 120+ browser demos in the [Crypto Lab](https://crypto-lab.systemslibrarian.dev/) suite.*\n\n*\"So whether you eat or drink or whatever you do, do it all for the glory of God.\" — 1 Corinthians 10:31*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-hash-zoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-hash-zoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-hash-zoo/lists"}