Earnie

We tested three cryptography detection tools on the same code.

In the top cryptographic libraries of five languages, Earnie found 99.8% of the cryptography. The next best tool found 17.7%. And of the three, only Earnie could tell which of that cryptography an application actually uses.

Same code, three answers

A small JavaScript app calls library A, which calls library B. Library B holds an HMAC signer the app uses and a SHA-1 function nothing calls.

Orange lines are the calls Earnie followed.

cdxgen13.6.0

sha-1

codec.js, line 18

Unknown

sha-256

codec.js, line 6

Unknown

It can’t say which one runs, so someone has to read the code to sort them.

The app no longer uses the signer, and the list doesn’t change.

sonar-cryptography1.7.0

0 findings

No JavaScript support.

On the Java version of this same test it also reported nothing.

Still nothing, in either version.

crypto-finder v0.54.0

HMAC-SHA-256

codec.js, line 6 · depth 2

ReachableNot reachable

SHA-1

codec.js, line 18 · depth 2

Not reachable

legacyDigest() has no caller, so the SHA-1 is not reachable.

Now nothing calls the signer, so the HMAC flips to not reachable.

Source: Every report is a file in the benchmark repository.

That’s the difference between a list and a plan.

A post-quantum migration starts with an inventory of the cryptography you ship. Most of it sits in dependencies your team didn’t write, and a flat list gives every finding the same weight. Earnie sorts it by what your code actually reaches.

Fix firstExample

RSA-1024

signing path

Reachable

Quantum-vulnerable cryptography your code calls. This is the live risk.

Schedule or remove

SHA-1

legacyDigest()

Not reachable

It ships but never runs. Delete the dead path, or plan it for later.

Keep and track

HMAC-SHA-256

sign()

Reachable

Strong and in use. It stays in your CBOM.

The SHA-1 and HMAC-SHA-256 are the two findings from the test above. cdxgen reports both with the same weight.

And your build only breaks for what runs.

Earnie’s built-in policy, “Block reachable weak cryptography”, stops a build only when a finding is reachable and rated critical or high. Dead code doesn’t break your build.

Build check

RSA-1024

signing path

ReachableCritical
Blocked

SHA-1

legacyDigest()

Not reachableHigh
Passes

HMAC-SHA-256

sign()

ReachableLow
Passes
Severities are illustrative.

Earnie also finds more of it.

Recall is how much of the cryptography in the code a tool found. Precision is how much of what it reported was real cryptography.

Benchmark results by test and tool
TestEarniecrypto-finder v0.54.0sonar-cryptography1.7.0cdxgen13.6.0
Top cryptographic libraries1,416 assets, recall / precision99.8% / 99.4%17.7% / 77.7%7.9% / 59.3%
Cryptographic reachability45 test pairs45 of 45 pairs rightDoesn’t report cryptographic reachabilityDoesn’t report cryptographic reachability
Real open source code214 assets, test files scanned, recall / precision86.0% / 92.9%22.4% / 100%8.4% / 35.3%

Results as of . sonar-cryptography supports Go, Java and Python only. On real code, all three tools scanned test files. Earnie leaves them out by default: its first score in the repo, run that way, is 50.5% at 93.1% precision. In the repo, Earnie’s cryptography detection is called crypto-finder. Scored on crypto-finder v0.54.0 (real code on v0.53.1). The current release, v1.0.4, gives the same results.

We trust our data. You don’t have to. Check this benchmark on your own terms.

We set the pass targets before tuning any tool to meet them. When we change a matching rule, we log the change and apply it to every tool. Two independent AI agents labelled every test case, and we settled each disagreement against a written guide. Each tool’s predictions, scores and misses are in the benchmark repository on GitHub. You can re-score any tool yourself from its stored predictions, without an API key.

What this benchmark doesn’t prove yet.

Cryptographic reachability is scored on controlled test pairs, not yet on real repositories. The real-code sample is small, so one repository can move a whole row. No human labelled the data. Earnie finds calls into cryptographic libraries, not cryptography a project writes itself. If you think a tool gets a case wrong, propose a test case.

See it on your own code.

The benchmark shows how the tools compare. Your own code shows what you ship, and which of it runs.

See it on your own code

Or start free with SBOM to CBOM.

Cryptography detection benchmark | Earnie
Earnie

We tested three cryptography detection tools on the same code.

In the top cryptographic libraries of five languages, Earnie found 99.8% of the cryptography. The next best tool found 17.7%. And of the three, only Earnie could tell which of that cryptography an application actually uses.

Same code, three answers

A small JavaScript app calls library A, which calls library B. Library B holds an HMAC signer the app uses and a SHA-1 function nothing calls.

Orange lines are the calls Earnie followed.

cdxgen13.6.0

sha-1

codec.js, line 18

Unknown

sha-256

codec.js, line 6

Unknown

It can’t say which one runs, so someone has to read the code to sort them.

The app no longer uses the signer, and the list doesn’t change.

sonar-cryptography1.7.0

0 findings

No JavaScript support.

On the Java version of this same test it also reported nothing.

Still nothing, in either version.

crypto-finder v0.54.0

HMAC-SHA-256

codec.js, line 6 · depth 2

ReachableNot reachable

SHA-1

codec.js, line 18 · depth 2

Not reachable

legacyDigest() has no caller, so the SHA-1 is not reachable.

Now nothing calls the signer, so the HMAC flips to not reachable.

Source: Every report is a file in the benchmark repository.

That’s the difference between a list and a plan.

A post-quantum migration starts with an inventory of the cryptography you ship. Most of it sits in dependencies your team didn’t write, and a flat list gives every finding the same weight. Earnie sorts it by what your code actually reaches.

Fix firstExample

RSA-1024

signing path

Reachable

Quantum-vulnerable cryptography your code calls. This is the live risk.

Schedule or remove

SHA-1

legacyDigest()

Not reachable

It ships but never runs. Delete the dead path, or plan it for later.

Keep and track

HMAC-SHA-256

sign()

Reachable

Strong and in use. It stays in your CBOM.

The SHA-1 and HMAC-SHA-256 are the two findings from the test above. cdxgen reports both with the same weight.

And your build only breaks for what runs.

Earnie’s built-in policy, “Block reachable weak cryptography”, stops a build only when a finding is reachable and rated critical or high. Dead code doesn’t break your build.

Build check

RSA-1024

signing path

ReachableCritical
Blocked

SHA-1

legacyDigest()

Not reachableHigh
Passes

HMAC-SHA-256

sign()

ReachableLow
Passes
Severities are illustrative.

Earnie also finds more of it.

Recall is how much of the cryptography in the code a tool found. Precision is how much of what it reported was real cryptography.

Benchmark results by test and tool
TestEarniecrypto-finder v0.54.0sonar-cryptography1.7.0cdxgen13.6.0
Top cryptographic libraries1,416 assets, recall / precision99.8% / 99.4%17.7% / 77.7%7.9% / 59.3%
Cryptographic reachability45 test pairs45 of 45 pairs rightDoesn’t report cryptographic reachabilityDoesn’t report cryptographic reachability
Real open source code214 assets, test files scanned, recall / precision86.0% / 92.9%22.4% / 100%8.4% / 35.3%

Results as of . sonar-cryptography supports Go, Java and Python only. On real code, all three tools scanned test files. Earnie leaves them out by default: its first score in the repo, run that way, is 50.5% at 93.1% precision. In the repo, Earnie’s cryptography detection is called crypto-finder. Scored on crypto-finder v0.54.0 (real code on v0.53.1). The current release, v1.0.4, gives the same results.

We trust our data. You don’t have to. Check this benchmark on your own terms.

We set the pass targets before tuning any tool to meet them. When we change a matching rule, we log the change and apply it to every tool. Two independent AI agents labelled every test case, and we settled each disagreement against a written guide. Each tool’s predictions, scores and misses are in the benchmark repository on GitHub. You can re-score any tool yourself from its stored predictions, without an API key.

What this benchmark doesn’t prove yet.

Cryptographic reachability is scored on controlled test pairs, not yet on real repositories. The real-code sample is small, so one repository can move a whole row. No human labelled the data. Earnie finds calls into cryptographic libraries, not cryptography a project writes itself. If you think a tool gets a case wrong, propose a test case.

See it on your own code.

The benchmark shows how the tools compare. Your own code shows what you ship, and which of it runs.

See it on your own code

Or start free with SBOM to CBOM.