Skip to content

DEF CON 34 talks are here: 354 talks, summarized and searchable.

Browse DEF CON 34

Crypto Is Fine - The Code Is Not - Real World Cryptographic Failures

Diptendu Kar

Where

Crypto Privacy Village
DEF CON 34

Duration

30 min

Shows how missing checks around signature verification, ECDH public keys, and JWT algorithm selection break cryptography in real CVEs, with live demos.

Summary

The talk argues that cryptographic failures in real software usually come from the code around the primitives, not the math. Drawing on OWASP A04:2025 and GitHub Security Advisories current to January 2026, the speaker finds that two weakness classes, signature verification flaws (CWE-347) and algorithm choice problems (CWE-327), account for over half of the A04 findings.

The middle section walks through three real CVEs, each reduced to one missing check. In an ECDSA library, verification never confirmed that the r and s values were in range, so submitting zeros produced a signature that passed. A JavaScript secp256k1 package skipped the on-curve test for compressed public keys, enabling an invalid curve attack against a static server key. The attacker recovers the secret by combining results from several small-order points with the Chinese remainder theorem, demonstrated on a scaled-down key. In a Python JWT library, a block list of known key strings failed to stop an attacker from forcing an HMAC check that uses the server's public key as the secret, which allowed forging an admin token.

The closing section turns these into a review checklist: identify which cryptographic inputs an attacker controls, check the specification's range, format, and curve requirements before the operation, never let the token choose the algorithm, and prefer allow lists over block lists. The speaker notes that similar bugs appeared in advisories dated 2026, so the lesson is to avoid writing your own primitives while still validating everything that comes from someone else's library.

Materials

Related talks