Digital Signatures vs Error Detection Codes: Stop Conflating Integrity With Authenticity
Both protect data, but only one of them survives an attacker. Error detection codes catch accidents. Digital signatures catch liars. Pick by your threat model — and most people pick wrong.
The short answer
Digital Signatures over Error Detection Codes Stop Conflating Integrity With Authenticity for most cases. Digital signatures win whenever a human or system could be adversarial, because they provide authenticity and non-repudiation, not just integrity.
- Pick Digital Signatures if anything could be tampered with on purpose: software updates, API tokens, financial messages, document provenance, supply-chain artifacts. You need to prove WHO produced the data, not just that bits didn't flip
- Pick Error Detection Codes Stop Conflating Integrity With Authenticity if the only adversary is line noise or disk rot — Ethernet frames, storage blocks, network packets — and you need cheap, fast, in-flight corruption detection with zero security pretensions
- Also consider: They are not competitors; they are layers. Real systems use a CRC at the link layer AND a signature at the application layer. Use a MAC (HMAC) instead of a signature if both parties share a secret and you don't need non-repudiation.
— Nice Pick, opinionated tool recommendations
They Solve Different Problems — One Is Security, One Isn't
This comparison is a trap people walk into constantly. An error detection code (CRC, checksum, parity) answers exactly one question: did these bits change by accident? A digital signature answers two harder ones: did these bits change at all, and who vouches for them? The difference is the adversary. EDCs assume your enemy is physics — cosmic rays, attenuation, a flaky cable. Signatures assume your enemy is a person who wants to lie to you. If you treat a CRC32 as a security control, you have built a lock that announces its own combination. Anyone who edits your payload simply recomputes the CRC and moves on. The math in a signature is deliberately one-way and key-bound precisely so the attacker can't do that. Confusing 'the data is intact' with 'the data is authentic' is the single most common integrity-design mistake in the field.
Why Error Detection Codes Are Useless Against Attackers
CRCs are linear, public, and keyless — three properties that make them fast and make them worthless against malice. Linear means an attacker can compute exactly which bit-flips cancel out in the checksum; CRC collisions are a homework exercise, not a research problem. Public means there's no secret to not know — the polynomial is in an RFC. Keyless means there's nothing tying the code to an identity. Even a cryptographic hash like SHA-256 doesn't save you here: if the attacker controls the data, they control the hash too, so a bare hash proves nothing about origin. That's the gap. EDCs are brilliant at their actual job — Ethernet's CRC catches transmission errors at billions of frames per second with near-zero cost. But the moment a human with intent enters your threat model, an EDC contributes exactly nothing. Don't dress one up as integrity protection in a security review. Reviewers who know better will laugh.
What Signatures Cost You — And Why It's Worth It
Signatures aren't free, and pretending otherwise is how you end up bottlenecked. Asymmetric signing (RSA, ECDSA, Ed25519) is orders of magnitude slower than a CRC and demands key management: generation, distribution, rotation, revocation, and a trust anchor (PKI, a keyring, or pinned keys). Get the key lifecycle wrong and the cryptography is theater. You also inherit verification overhead on every consumer and a real risk of footguns — nonce reuse in ECDSA has leaked private keys in production more than once. Ed25519 mitigates most of these and should be your default. But for that cost you buy properties an EDC can never offer: authenticity (this came from the holder of the private key) and non-repudiation (they can't later deny it). For software updates, signed releases, JWTs, code signing, and document provenance, that's the entire point. The overhead is the price of admission to a world with adversaries.
The Right Architecture Uses Both
Stop framing this as either/or — mature systems stack them. A signed firmware image still rides over a link protected by a CRC. TLS records carry a sequence-number-bound MAC for tamper resistance while lower layers run their own frame checks for noise. Each layer handles the threat it's good at: EDCs absorb cheap, high-volume accidental corruption so it never reaches your expensive crypto; signatures or MACs handle the adversary. One nuance worth getting right: if both endpoints share a secret and you don't need to prove origin to a third party, use HMAC, not a full signature — it's faster and simpler, and it gives you authenticated integrity without key-pair overhead. Reach for a real digital signature specifically when non-repudiation or open verification by parties who don't share your secret matters. Choose by threat model, layer by layer, and never let a checksum masquerade as a signature in a security boundary.
Quick Comparison
| Factor | Digital Signatures | Error Detection Codes Stop Conflating Integrity With Authenticity |
|---|---|---|
| Protects against malicious tampering | Yes — key-bound, forgery-resistant | No — attacker recomputes the code |
| Proves origin / authenticity | Yes — ties data to a private key | None — keyless, identity-blind |
| Speed and compute cost | Slow; asymmetric crypto per verify | Extremely fast, near-zero cost |
| Operational complexity | Key management, PKI, rotation, revocation | None — public polynomial, stateless |
| Catches accidental bit-flips / noise | Yes, but overkill for the job | Yes — exactly what it's built for |
The Verdict
Use Digital Signatures if: Anything could be tampered with on purpose: software updates, API tokens, financial messages, document provenance, supply-chain artifacts. You need to prove WHO produced the data, not just that bits didn't flip.
Use Error Detection Codes Stop Conflating Integrity With Authenticity if: The only adversary is line noise or disk rot — Ethernet frames, storage blocks, network packets — and you need cheap, fast, in-flight corruption detection with zero security pretensions.
Consider: They are not competitors; they are layers. Real systems use a CRC at the link layer AND a signature at the application layer. Use a MAC (HMAC) instead of a signature if both parties share a secret and you don't need non-repudiation.
Digital signatures win whenever a human or system could be adversarial, because they provide authenticity and non-repudiation, not just integrity. Error detection codes are trivially forgeable — recompute the CRC after tampering and nobody's the wiser. The only place EDCs win is raw speed on a trusted channel where the only enemy is noise.
Related Comparisons
Disagree? nice@nicepick.dev