.

.

.

.

ATTACKCVE‑2025‑14505JScanPrivKeyMATHRECOVERYRESEARCH
CVE-2025-14505 // HIDDEN NUMBER PROBLEM

CRYPTOGRAPHIC
BLACK SWAN
ATTACK

Systematic NONCE value misalignment in Elliptic signatures → lattice attack → full private key recovery via Hidden Number Problem. Real‑world exploit on Bitcoin wallets.

EXPLOIT MECHANISM

CVE‑2025‑14505: Elliptic nonce truncation & RFC 6979 flaw

The JavaScript package Elliptic (≤6.6.1) implements deterministic nonce generation (RFC 6979) incorrectly. The function _truncateToN() mishandles leading zero bytes, causing truncation of the ephemeral nonce k when it contains leading zero bits. Probability ≈ 0.39% per signature. Mathematically: k_faulty = k_correct mod 2^(256 - m) with m=8 for one leading zero byte. Attackers collect 40–50 signatures with biased nonces → private key recovery via lattice reduction (LLL) and Hidden Number Problem.

📌 Affected scope

  • Elliptic npm package versions ≤6.6.1 (>100M monthly downloads)
  • Bitcoin wallets using vulnerable deterministic nonce generation
  • Any ECDSA (secp256k1) transaction signed with flawed library
CVE-2025-14505 diagram

JScanPrivKey — automated lattice‑based key recovery

Developed by Günther Zöeir research center, JScanPrivKey is a highly specialized cryptanalytic toolkit that scans blockchain transactions, extracts ECDSA signatures, detects nonce bias/truncation, builds Hidden Number Problem lattices, performs LLL reduction, and recovers private keys.

Blockchain scanner

Extracts (r, s, z, public key) from Bitcoin Core / APIs, filters vulnerable patterns.

Statistical bias detection

Fourier analysis & χ² test to identify truncated nonces (leading zero bits).

Lattice construction

HNP lattice of dimension (m+1)×(m+1) with normalization coefficients 2^ℓ.

LLL reduction + predicate

Parallel LLL, Bounded Distance Decoding with predicate verification (Q = d·G).

$ ./jscanprivkey --target 1NiojfedphT6MgMD7UsowNdQmx5JY15djG --scan-range 450000-460000
[+] 47 signatures found, 3 with truncation pattern (m=8 bits)
[+] Lattice dimension 4x4, LLL reduction completed in 247s
[+] Private key recovered: 4ACBB2E3CE1EE22224219B71E3B72BF6C8F2C9AA1D992666DBD8B48AA826FF6B

Source: b8c.ru/jscanprivkey | github.com/zoeir

Hidden Number Problem → Lattice Attack

ECDSA signature equation: s = k⁻¹(z + r·d) mod n. For truncated nonce: k_faulty = k_correct mod 2^(n−m). Write k_i = 2^m·x_i + ε_i (ε_i known small). Then: r_i·d − 2^m·s_i·x_i ≡ s_i·ε_i − z_i (mod n). This forms HNP: t_i·d + u_i·x_i ≡ w_i (mod n).

// Lattice basis (m+1 dimension)
B = [[ n,     0, …,     0, t₁ ],
     [ 0,     n, …,     0, t₂ ],
     …
     [ 0,     0, …,     n, t_m ],
     [ 0,     0, …,     0, C ]]
Target vector v = (x₁, …, x_m, d·C / n)  (short vector)

LLL reduction yields short vector → extract candidate d' → verify via Q' = d'·G matches target address. With 32-64 signatures success probability >95%.

lattice attack

Recovered wallet: 1NiojfedphT6MgMD7UsowNdQmx5JY15djG

Blockchain analysis revealed 47 outgoing transactions (2017, block range 453k-454k). JScanPrivKey identified 3 signatures with r-values significantly lower than n/2 (truncation evidence). Using 8‑bit truncation model, a 4×4 HNP lattice was solved via LLL (δ=0.99) in 247 seconds on AMD EPYC 7742.

🔑 Recovered Private Key (HEX)

4ACBB2E3CE1EE22224219B71E3B72BF6C8F2C9AA1D992666DBD8B48AA826FF6B

📦 WIF compressed

Kyj6yvb4oHHDGBW23C8Chzji3zdYQ5QMr8r9zWpGVHdvWuYqCGVU

🏦 Public key (compressed)

03AE73430C02577F3A7DA6F3EDC51AF4ECBB41962B937DBC2D382CABB11D0D18CE

✅ Bitcoin address match

1NiojfedphT6MgMD7UsowNdQmx5JY15djG

Financial impact: recovered balance 0.513 BTC (~$61,025). Total transaction volume of wallet: 2.85 BTC. Full cryptographic verification performed.

$ echo "Recovery time: 23 minutes (scan + lattice + verify)"
$ sha256sum private.key → matches blockchain signature fingerprint.

CryptoDeepTech & KEYHUNTERS analysis

Two independent research groups documented the full attack chain: CryptoDeepTech (CVE‑2025‑14505 discovery, mathematical formalization, JScanPrivKey architecture) and KEYHUNTERS (nonce reuse & deterministic generation flaws, historical Bitcoin wallet compromise). Both confirm that the Elliptic vulnerability leads to systematic private key exposure via lattice cryptanalysis.

📄 CryptoDeepTech

“Cryptographic Black Swan Attack: Systematic NONCE Value Misalignment” — detailed HNP transformation, probability analysis, LLL success rate (95% with 50 signatures). Demonstrated on real address with 47 transactions.

Read paper →

🔐 KEYHUNTERS

“Nonce Reuse Attack & Private Key Recovery” — historical cases, RFC6979 pitfalls, practical verification using btcd/ecdsa. Showed recovery of wallet 1CgCMLupoVAnxFJwHTYTKrrRD3uoi3r1ag (5.28 BTC).

Read research →
attack diagram

⚡ Key conclusions from both papers

  • Implementation errors in deterministic nonce generation (RFC 6979) are more dangerous than weak RNGs.
  • LLL lattice reduction solves HNP with 40–60 biased signatures, recovering 256‑bit private keys in minutes.
  • Millions of Bitcoin addresses created using Elliptic ≤6.6.1 are at risk.
  • Immediate mitigation: update to Elliptic ≥6.6.2 or migrate to @noble/curves/secp256k1.
# References
• RFC 6979 – Deterministic Usage of DSA/ECDSA
• Boneh & Venkatesan – Hidden Number Problem (1996)
• Lenstra–Lenstra–Lovász lattice reduction
• CVE-2025-14505 (NVD) – Elliptic package truncation vulnerability
• JScanPrivKey source: Günther Zöeir research center

Securing Bitcoin wallets against nonce attacks

✔ Immediate actions

  • Update elliptic library ≥6.6.2
  • Rotate all keys that may have been used with vulnerable versions
  • Use @noble/curves/secp256k1 or audited alternatives
  • Implement RFC6979 correctly with edge-case tests (leading zero bytes)

🔬 Long‑term strategies

  • Formal verification of nonce generation
  • Hedged signatures: k = H(d, m, random)
  • Regular blockchain forensic audits
  • Adoption of BIP340 Schnorr signatures (reduces nonce risks)

The Cryptographic Black Swan Attack proves that deterministic schemes must be implemented with extreme rigor. Use JScanPrivKey for authorized security audits and wallet recovery under legal ownership.