[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AMKPSTND5BV5NDV7MPBRS7":3,"skill-same:01M7AMKPSTND5BV5NDV7MPBRS7":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7AMKPSTND5BV5NDV7MPBRS7","crypto-what-it-solves-threat-models-randomness-hashes-and-macs",null,"Use before choosing any primitive: what cryptography does and does not solve and the problems people wrongly expect it to fix, threat models and what you are actually defending against, randomness and why CSPRNG choice and seeding is a common silent failure, hash functions and their security properties, and MACs and authentication. Includes the router for the whole cryptography reference.","the-vibey-project\u002Fvibey","the-vibey-project","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F329298758?v=4","01M7AJHGZ9722CTJ4JNQZVRH0Q","the vibey project","01M7AJHGZVMG2K7TGXQ6XFHVG3",5,"MIT","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fcryptography-and-encryption\u002Fskills\u002Fcrypto-what-it-solves-threat-models-randomness-hashes-and-macs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: crypto-what-it-solves-threat-models-randomness-hashes-and-macs\ndescription: \"Use before choosing any primitive: what cryptography does and does not solve and the problems people wrongly expect it to fix, threat models and what you are actually defending against, randomness and why CSPRNG choice and seeding is a common silent failure, hash functions and their security properties, and MACs and authentication. Includes the router for the whole cryptography reference.\"\n---\n\n# Cryptography: What Cryptography Does and Doesn't Solve, Threat Models, Randomness, Hash Functions, and MACs\n\n> **Part 1 of 6** of the *Cryptography and Encryption* reference (plugin `cryptography-and-encryption`), covering §0–§5. Sibling skills: `crypto-symmetric-aead-public-key-and-signatures` (§6–§10), `crypto-passwords-tls-pki-messaging-and-disk-encryption` (§11–§16), `crypto-implementation-failures-key-management-and-agility` (§17–§19), `crypto-advanced-constructions-blockchain-and-policy` (§20–§22), `crypto-reference` (§23–§28). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** The primitives are stable. Two migrations are actively underway. See §23 → `crypto-reference` for post-quantum cryptography, and TLS certificate lifetimes.\n\n> **⚠️ Cryptography is the part of security that mostly WORKS. The primitives are rarely\n> broken; the systems built from them fail constantly** (§17 → `crypto-implementation-failures-key-management-and-agility`). ⚠️ **Almost every real-world\n> break is a key management failure, an implementation bug, a protocol composition error,\n> or a human process — not a cryptanalytic result.**\n>\n> **⚠️ THE RULE THAT MATTERS MOST: don't build it yourself.** ⚠️ **Use a vetted,\n> well-maintained library at the highest level of abstraction that solves your problem.\n> This document is for UNDERSTANDING what those libraries do and evaluating designs —\n> not a recipe for implementing primitives.**\n>\n> **Complements an electromagnetism reference (the physical layer), and security-focused\n> material on threat modelling and application security.**\n>\n> **⚠️ GOTCHA** boxes mark the failure modes that have caused real breaches.\n>\n> **The three ideas that organize this document:**\n> 1. **⚠️ ENCRYPTION WITHOUT AUTHENTICATION IS BROKEN** (§7 → `crypto-symmetric-aead-public-key-and-signatures`). **Confidentiality alone is\n>    almost never what you want, and unauthenticated ciphertext is malleable. Use AEAD.**\n> 2. **⚠️ KEY MANAGEMENT IS THE HARD PART** (§18 → `crypto-implementation-failures-key-management-and-agility`). **The algorithm choice is usually easy\n>    and usually not where you lose. Where keys live, who can reach them, and how they\n>    rotate is where systems actually fail.**\n> 3. **⚠️ AGILITY IS A DESIGN REQUIREMENT** (§19 → `crypto-implementation-failures-key-management-and-agility`, §23 → `crypto-reference`). **Every algorithm eventually\n>    weakens. Systems that hardcoded their primitives are the ones in pain right now.**\n\n---\n\n## §0. Routing\n\n| You want... | Go to |\n|---|---|\n| **⚠️ What crypto does and doesn't solve** | **§1** |\n| Threat models | §2 |\n| **⚠️ Randomness** | **§3** |\n| Hash functions | §4 |\n| MACs | §5 |\n| Symmetric ciphers and modes | §6 → `crypto-symmetric-aead-public-key-and-signatures` |\n| **⚠️ AEAD** | **§7 → `crypto-symmetric-aead-public-key-and-signatures`** |\n| Public key | §8 → `crypto-symmetric-aead-public-key-and-signatures` |\n| Key exchange and forward secrecy | §9 → `crypto-symmetric-aead-public-key-and-signatures` |\n| Signatures | §10 → `crypto-symmetric-aead-public-key-and-signatures` |\n| **⚠️ Password storage** | **§11 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`** |\n| **TLS** | **§12 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`** |\n| PKI and certificates | §13 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| End-to-end messaging | §14 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| Disk and file encryption | §15 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| Other protocols | §16 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| **⚠️ Implementation failures** | **§17 → `crypto-implementation-failures-key-management-and-agility`** |\n| **⚠️ Key management** | **§18 → `crypto-implementation-failures-key-management-and-agility`** |\n| Crypto agility | §19 → `crypto-implementation-failures-key-management-and-agility` |\n| Advanced constructions | §20 → `crypto-advanced-constructions-blockchain-and-policy` |\n| Blockchain crypto | §21 → `crypto-advanced-constructions-blockchain-and-policy` |\n| Law and policy | §22 → `crypto-advanced-constructions-blockchain-and-policy` |\n| **What's live** | **§23 → `crypto-reference`** |\n| Misconceptions, numbers | §24–§25 → `crypto-reference` |\n| Books, quick ref, method | §26–§28 → `crypto-reference` |\n\n---\n\n## §1. ⚠️ What Cryptography Does and Doesn't Solve\n\n```\n⚠️ THE FOUR GOALS\n   ⚠️ CONFIDENTIALITY  nobody else can read it\n   ⚠️ INTEGRITY  it hasn't been altered\n   ⚠️ AUTHENTICITY  it's from who you think\n   ⚠️ NON-REPUDIATION  they can't later deny sending it\n   ⚠️ These are DIFFERENT and require DIFFERENT mechanisms.\n   ⚠️ Confusing them is the root of many design errors\n⚠️ WHAT CRYPTO CANNOT DO\n   ⚠️ Protect against a compromised ENDPOINT. ⚠️ If the attacker is\n      on the device, encryption in transit is irrelevant\n   ⚠️ Hide METADATA — ⚠️ who talked to whom, when, how often and how\n      much. ⚠️ Metadata is frequently more revealing than content\n   ⚠️ Fix a bad trust model. ⚠️ Encryption to the wrong party is\n      perfectly secure and completely useless\n   ⚠️ Solve authorization, availability, or insider abuse\n   ⚠️ Compensate for users who will click through any warning\n```\n> **⚠️ GOTCHA — \"don't roll your own crypto\" is often misunderstood as being about\n> ALGORITHMS. It's mostly about PROTOCOLS AND IMPLEMENTATIONS.** ⚠️ **Nobody sensible\n> designs a new block cipher; plenty of teams compose existing primitives into a novel\n> protocol, and that is where the failures come from.**\n> **⚠️ The practical version: use libsodium\u002FNaCl, Tink, the platform's crypto API, or an\n> equivalent — at the highest level that solves your problem. ⚠️ If your code contains a\n> mode of operation, an IV, or a padding decision, you are already lower-level than you\n> probably need to be.**\n\n---\n\n## §2. Threat Models\n\n**⚠️ KERCKHOFFS'S PRINCIPLE**: ⚠️ **the system should be secure even if everything about it\nexcept the key is public knowledge.** **⚠️ \"Security through obscurity\" fails because\nobscurity is not a secret you can rotate.**\n```\n⚠️ ADVERSARY MODELS, in ascending strength\n   PASSIVE \u002F eavesdropper · ⚠️ ACTIVE \u002F can modify, inject, replay ·\n   ⚠️ CHOSEN-PLAINTEXT and CHOSEN-CIPHERTEXT · ⚠️ ADAPTIVE ·\n   ⚠️ PHYSICAL ACCESS (side channels, §17) · ⚠️ INSIDER\n⚠️ THE QUESTIONS THAT DEFINE A DESIGN\n   ⚠️ Who is the adversary and what can they DO?\n   ⚠️ What must stay secret, and FOR HOW LONG? (§23.1)\n   ⚠️ What is the trusted computing base?\n   ⚠️ What happens when a key is compromised? (§9, §18)\n```\n**⚠️ Security proofs are conditional**: ⚠️ **\"provably secure\" means \"reduces to a problem\nwe believe is hard, in a stated model, assuming the implementation is correct.\"** **⚠️ All\nthree qualifiers have failed in practice.**\n\n---\n\n# PART I — PRIMITIVES\n\n## §3. ⚠️ Randomness\n\n> **⚠️ The most under-appreciated failure point, and it breaks everything above it\n> silently. Bad randomness produces output that LOOKS fine.**\n```\n⚠️ USE THE OPERATING SYSTEM CSPRNG. Always.\n   ⚠️ \u002Fdev\u002Furandom, getrandom(), BCryptGenRandom, SecRandomCopyBytes\n   ⚠️ NEVER a language's default rand()\u002FMath.random() — those are\n      statistical PRNGs, deliberately fast and entirely predictable\n⚠️ WHERE IT HAS GONE WRONG IN REALITY\n   ⚠️ Insufficient entropy at BOOT on embedded devices and VMs —\n      ⚠️ producing duplicate keys across many devices\n   ⚠️ VM cloning replaying the same RNG state\n   ⚠️ A distribution patch that reduced the effective keyspace\n      of every key generated for years\n   ⚠️ Deterministic nonce generation from a predictable counter (§17)\n⚠️ THE \u002Fdev\u002Frandom vs \u002Fdev\u002Furandom DEBATE IS SETTLED on modern\n   systems: ⚠️ once seeded, urandom is fine and blocking is not a\n   security benefit\n```\n\n---\n\n## §4. Hash Functions\n\n**⚠️ Properties**: ⚠️ **preimage resistance, second preimage resistance, and COLLISION\nresistance — and collision resistance is the weakest of the three and the first to fall.**\n```\n⚠️ STATUS\n   ⚠️ MD5  BROKEN. Collisions are trivial. ⚠️ Not for anything security-related\n   ⚠️ SHA-1  BROKEN for collisions (chosen-prefix collisions demonstrated).\n      ⚠️ Deprecated everywhere that matters\n   ⚠️ SHA-2 (SHA-256\u002F384\u002F512)  ⚠️ the current workhorse. Fine\n   ⚠️ SHA-3 \u002F Keccak  different internal structure (sponge) — ⚠️ a\n      structural hedge rather than a replacement\n   ⚠️ BLAKE2\u002FBLAKE3  fast, secure, good choices\n⚠️ LENGTH EXTENSION  ⚠️ SHA-2 (Merkle-Damgård) is vulnerable: knowing\n   H(m) lets you compute H(m ‖ padding ‖ extra) without knowing m.\n   ⚠️ THIS IS WHY H(key ‖ message) IS NOT A MAC (§5)\n   ⚠️ SHA-3 and BLAKE are not vulnerable\n```\n> **⚠️ GOTCHA — collision resistance matters when an ATTACKER CONTROLS BOTH INPUTS\n> (certificates, signed documents, code signing).** ⚠️ **It matters much less for HMAC or\n> for a random-input use.** **⚠️ This is why SHA-1 was catastrophic for certificates and\n> merely undesirable inside HMAC — but migrate anyway, because arguing about it costs more\n> than replacing it.**\n**⚠️ Do NOT use general-purpose hashes for passwords** (§11 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`) — ⚠️ **their speed is the\nproblem.**\n\n---\n\n## §5. MACs\n\n**⚠️ A MAC provides integrity and authenticity with a SHARED key.**\n⚠️ **HMAC is the standard construction and is specifically designed to resist §4's length\nextension.** ⚠️ **Poly1305 and KMAC are also good.**\n**⚠️ CRITICAL PROPERTIES**:\n⚠️ **verify in CONSTANT TIME (§17 → `crypto-implementation-failures-key-management-and-agility`) — a naive byte-by-byte comparison leaks the correct\nvalue through timing, one byte at a time; and use a SEPARATE key from encryption, or\nbetter, use AEAD (§7 → `crypto-symmetric-aead-public-key-and-signatures`) which handles it.**\n**⚠️ A MAC is NOT a signature** — ⚠️ **both parties hold the same key, so a MAC cannot prove\nto a third party who created it.** **No non-repudiation** (§1).\n","# Cryptography: What Cryptography Does and Doesn't Solve, Threat Models, Randomness, Hash Functions, and MACs\n\n> **Part 1 of 6** of the *Cryptography and Encryption* reference (plugin `cryptography-and-encryption`), covering §0–§5. Sibling skills: `crypto-symmetric-aead-public-key-and-signatures` (§6–§10), `crypto-passwords-tls-pki-messaging-and-disk-encryption` (§11–§16), `crypto-implementation-failures-key-management-and-agility` (§17–§19), `crypto-advanced-constructions-blockchain-and-policy` (§20–§22), `crypto-reference` (§23–§28). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** The primitives are stable. Two migrations are actively underway. See §23 → `crypto-reference` for post-quantum cryptography, and TLS certificate lifetimes.\n\n> **⚠️ Cryptography is the part of security that mostly WORKS. The primitives are rarely\n> broken; the systems built from them fail constantly** (§17 → `crypto-implementation-failures-key-management-and-agility`). ⚠️ **Almost every real-world\n> break is a key management failure, an implementation bug, a protocol composition error,\n> or a human process — not a cryptanalytic result.**\n>\n> **⚠️ THE RULE THAT MATTERS MOST: don't build it yourself.** ⚠️ **Use a vetted,\n> well-maintained library at the highest level of abstraction that solves your problem.\n> This document is for UNDERSTANDING what those libraries do and evaluating designs —\n> not a recipe for implementing primitives.**\n>\n> **Complements an electromagnetism reference (the physical layer), and security-focused\n> material on threat modelling and application security.**\n>\n> **⚠️ GOTCHA** boxes mark the failure modes that have caused real breaches.\n>\n> **The three ideas that organize this document:**\n> 1. **⚠️ ENCRYPTION WITHOUT AUTHENTICATION IS BROKEN** (§7 → `crypto-symmetric-aead-public-key-and-signatures`). **Confidentiality alone is\n>    almost never what you want, and unauthenticated ciphertext is malleable. Use AEAD.**\n> 2. **⚠️ KEY MANAGEMENT IS THE HARD PART** (§18 → `crypto-implementation-failures-key-management-and-agility`). **The algorithm choice is usually easy\n>    and usually not where you lose. Where keys live, who can reach them, and how they\n>    rotate is where systems actually fail.**\n> 3. **⚠️ AGILITY IS A DESIGN REQUIREMENT** (§19 → `crypto-implementation-failures-key-management-and-agility`, §23 → `crypto-reference`). **Every algorithm eventually\n>    weakens. Systems that hardcoded their primitives are the ones in pain right now.**\n\n---\n\n## §0. Routing\n\n| You want... | Go to |\n|---|---|\n| **⚠️ What crypto does and doesn't solve** | **§1** |\n| Threat models | §2 |\n| **⚠️ Randomness** | **§3** |\n| Hash functions | §4 |\n| MACs | §5 |\n| Symmetric ciphers and modes | §6 → `crypto-symmetric-aead-public-key-and-signatures` |\n| **⚠️ AEAD** | **§7 → `crypto-symmetric-aead-public-key-and-signatures`** |\n| Public key | §8 → `crypto-symmetric-aead-public-key-and-signatures` |\n| Key exchange and forward secrecy | §9 → `crypto-symmetric-aead-public-key-and-signatures` |\n| Signatures | §10 → `crypto-symmetric-aead-public-key-and-signatures` |\n| **⚠️ Password storage** | **§11 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`** |\n| **TLS** | **§12 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`** |\n| PKI and certificates | §13 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| End-to-end messaging | §14 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| Disk and file encryption | §15 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| Other protocols | §16 → `crypto-passwords-tls-pki-messaging-and-disk-encryption` |\n| **⚠️ Implementation failures** | **§17 → `crypto-implementation-failures-key-management-and-agility`** |\n| **⚠️ Key management** | **§18 → `crypto-implementation-failures-key-management-and-agility`** |\n| Crypto agility | §19 → `crypto-implementation-failures-key-management-and-agility` |\n| Advanced constructions | §20 → `crypto-advanced-constructions-blockchain-and-policy` |\n| Blockchain crypto | §21 → `crypto-advanced-constructions-blockchain-and-policy` |\n| Law and policy | §22 → `crypto-advanced-constructions-blockchain-and-policy` |\n| **What's live** | **§23 → `crypto-reference`** |\n| Misconceptions, numbers | §24–§25 → `crypto-reference` |\n| Books, quick ref, method | §26–§28 → `crypto-reference` |\n\n---\n\n## §1. ⚠️ What Cryptography Does and Doesn't Solve\n\n```\n⚠️ THE FOUR GOALS\n   ⚠️ CONFIDENTIALITY  nobody else can read it\n   ⚠️ INTEGRITY  it hasn't been altered\n   ⚠️ AUTHENTICITY  it's from who you think\n   ⚠️ NON-REPUDIATION  they can't later deny sending it\n   ⚠️ These are DIFFERENT and require DIFFERENT mechanisms.\n   ⚠️ Confusing them is the root of many design errors\n⚠️ WHAT CRYPTO CANNOT DO\n   ⚠️ Protect against a compromised ENDPOINT. ⚠️ If the attacker is\n      on the device, encryption in transit is irrelevant\n   ⚠️ Hide METADATA — ⚠️ who talked to whom, when, how often and how\n      much. ⚠️ Metadata is frequently more revealing than content\n   ⚠️ Fix a bad trust model. ⚠️ Encryption to the wrong party is\n      perfectly secure and completely useless\n   ⚠️ Solve authorization, availability, or insider abuse\n   ⚠️ Compensate for users who will click through any warning\n```\n> **⚠️ GOTCHA — \"don't roll your own crypto\" is often misunderstood as being about\n> ALGORITHMS. It's mostly about PROTOCOLS AND IMPLEMENTATIONS.** ⚠️ **Nobody sensible\n> designs a new block cipher; plenty of teams compose existing primitives into a novel\n> protocol, and that is where the failures come from.**\n> **⚠️ The practical version: use libsodium\u002FNaCl, Tink, the platform's crypto API, or an\n> equivalent — at the highest level that solves your problem. ⚠️ If your code contains a\n> mode of operation, an IV, or a padding decision, you are already lower-level than you\n> probably need to be.**\n\n---\n\n## §2. Threat Models\n\n**⚠️ KERCKHOFFS'S PRINCIPLE**: ⚠️ **the system should be secure even if everything about it\nexcept the key is public knowledge.** **⚠️ \"Security through obscurity\" fails because\nobscurity is not a secret you can rotate.**\n```\n⚠️ ADVERSARY MODELS, in ascending strength\n   PASSIVE \u002F eavesdropper · ⚠️ ACTIVE \u002F can modify, inject, replay ·\n   ⚠️ CHOSEN-PLAINTEXT and CHOSEN-CIPHERTEXT · ⚠️ ADAPTIVE ·\n   ⚠️ PHYSICAL ACCESS (side channels, §17) · ⚠️ INSIDER\n⚠️ THE QUESTIONS THAT DEFINE A DESIGN\n   ⚠️ Who is the adversary and what can they DO?\n   ⚠️ What must stay secret, and FOR HOW LONG? (§23.1)\n   ⚠️ What is the trusted computing base?\n   ⚠️ What happens when a key is compromised? (§9, §18)\n```\n**⚠️ Security proofs are conditional**: ⚠️ **\"provably secure\" means \"reduces to a problem\nwe believe is hard, in a stated model, assuming the implementation is correct.\"** **⚠️ All\nthree qualifiers have failed in practice.**\n\n---\n\n# PART I — PRIMITIVES\n\n## §3. ⚠️ Randomness\n\n> **⚠️ The most under-appreciated failure point, and it breaks everything above it\n> silently. Bad randomness produces output that LOOKS fine.**\n```\n⚠️ USE THE OPERATING SYSTEM CSPRNG. Always.\n   ⚠️ \u002Fdev\u002Furandom, getrandom(), BCryptGenRandom, SecRandomCopyBytes\n   ⚠️ NEVER a language's default rand()\u002FMath.random() — those are\n      statistical PRNGs, deliberately fast and entirely predictable\n⚠️ WHERE IT HAS GONE WRONG IN REALITY\n   ⚠️ Insufficient entropy at BOOT on embedded devices and VMs —\n      ⚠️ producing duplicate keys across many devices\n   ⚠️ VM cloning replaying the same RNG state\n   ⚠️ A distribution patch that reduced the effective keyspace\n      of every key generated for years\n   ⚠️ Deterministic nonce generation from a predictable counter (§17)\n⚠️ THE \u002Fdev\u002Frandom vs \u002Fdev\u002Furandom DEBATE IS SETTLED on modern\n   systems: ⚠️ once seeded, urandom is fine and blocking is not a\n   security benefit\n```\n\n---\n\n## §4. Hash Functions\n\n**⚠️ Properties**: ⚠️ **preimage resistance, second preimage resistance, and COLLISION\nresistance — and collision resistance is the weakest of the three and the first to fall.**\n```\n⚠️ STATUS\n   ⚠️ MD5  BROKEN. Collisions are trivial. ⚠️ Not for anything security-related\n   ⚠️ SHA-1  BROKEN for collisions (chosen-prefix collisions demonstrated).\n      ⚠️ Deprecated everywhere that matters\n   ⚠️ SHA-2 (SHA-256\u002F384\u002F512)  ⚠️ the current workhorse. Fine\n   ⚠️ SHA-3 \u002F Keccak  different internal structure (sponge) — ⚠️ a\n      structural hedge rather than a replacement\n   ⚠️ BLAKE2\u002FBLAKE3  fast, secure, good choices\n⚠️ LENGTH EXTENSION  ⚠️ SHA-2 (Merkle-Damgård) is vulnerable: knowing\n   H(m) lets you compute H(m ‖ padding ‖ extra) without knowing m.\n   ⚠️ THIS IS WHY H(key ‖ message) IS NOT A MAC (§5)\n   ⚠️ SHA-3 and BLAKE are not vulnerable\n```\n> **⚠️ GOTCHA — collision resistance matters when an ATTACKER CONTROLS BOTH INPUTS\n> (certificates, signed documents, code signing).** ⚠️ **It matters much less for HMAC or\n> for a random-input use.** **⚠️ This is why SHA-1 was catastrophic for certificates and\n> merely undesirable inside HMAC — but migrate anyway, because arguing about it costs more\n> than replacing it.**\n**⚠️ Do NOT use general-purpose hashes for passwords** (§11 → `crypto-passwords-tls-pki-messaging-and-disk-encryption`) — ⚠️ **their speed is the\nproblem.**\n\n---\n\n## §5. MACs\n\n**⚠️ A MAC provides integrity and authenticity with a SHARED key.**\n⚠️ **HMAC is the standard construction and is specifically designed to resist §4's length\nextension.** ⚠️ **Poly1305 and KMAC are also good.**\n**⚠️ CRITICAL PROPERTIES**:\n⚠️ **verify in CONSTANT TIME (§17 → `crypto-implementation-failures-key-management-and-agility`) — a naive byte-by-byte comparison leaks the correct\nvalue through timing, one byte at a time; and use a SEPARATE key from encryption, or\nbetter, use AEAD (§7 → `crypto-symmetric-aead-public-key-and-signatures`) which handles it.**\n**⚠️ A MAC is NOT a signature** — ⚠️ **both parties hold the same key, so a MAC cannot prove\nto a third party who created it.** **No non-repudiation** (§1).\n",{"name":5,"description":7},"develop","ae32736a1aabddabca5d2c96d665aa0ebc7d8700","src\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fcryptography-and-encryption\u002Fskills\u002Fcrypto-what-it-solves-threat-models-randomness-hashes-and-macs",3,"https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey","https:\u002F\u002Fthe-vibey-project.github.io\u002Fvibey\u002F","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project","https:\u002F\u002Fvibewithadam.matthewsteinberger.com","freedom for software engineers","2026-11-15 05:47:42",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add the-vibey-project\u002Fvibey --skill crypto-what-it-solves-threat-models-randomness-hashes-and-macs",{"tool":40,"command":41},"bunx","bunx skills add the-vibey-project\u002Fvibey --skill crypto-what-it-solves-threat-models-randomness-hashes-and-macs",{"tool":43,"command":44},"pnpm","pnpm dlx skills add the-vibey-project\u002Fvibey --skill crypto-what-it-solves-threat-models-randomness-hashes-and-macs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fcryptography-and-encryption\u002Fskills\u002Fcrypto-what-it-solves-threat-models-randomness-hashes-and-macs\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7AT1FQJAE1FQYAMDTF490Y4","white-paper-writing","Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks \"how should I structure this\" for a long-form document.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fwhite-paper-writing\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7AT16BJRJJKK2MASXRZS76G","prose-technical-mechanics","Use when editing or writing prose at a technical\u002Fmechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-technical-mechanics\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AT0W9HT0ZZ9Y287NW99MR3","prose-mechanics","Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate\u002FJamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix \"AI-sounding\" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-mechanics\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AT0KR635JX66X2X6F3E2CP","narrative-structure","Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or \"how should I structure this story\u002Fpitch\u002Fpresentation\" request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fnarrative-structure\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AT0AKGW09NKKZDYBT8VRDE","legal-brief-writing","Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic\u002Fneurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Flegal-brief-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT00VWPS4Q8B5VEMXX9NQT","journal-publishability-criteria","Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs\u002Fpaper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fjournal-publishability-criteria\u002FSKILL.md",[],[]]