CryptoDeepTools

repository·main·Indexed 42 days ago

https://github.com/demining/cryptodeeptools

A suite of cryptanalysis scripts and research implementations for the Bitcoin blockchain, ECDSA vulnerabilities, and elliptic curve mathematics. It includes tools for parsing blockchain data via Google Colab, analyzing ECDSA signatures with breakECDSA.py, checking Bitcoin address balances, and implementing Secp256k algorithms including Weil pairing and Miller's Algorithm. The toolkit also features a demonstration of the CVE-2008-0166 OpenSSL vulnerability via cryptodeepbtcgen and a Pollard's kangaroo interval ECDLP solver for SECP256K1.

Tokens
177.3K
Snippets
417
Records
762
Agent score
52%

What's inside CryptoDeepTools

  1. Overview of the Twist Attack implementation

    main

    The Twist Attack implementation demonstrates how to recover partial private key values using specific points on the secp256k1 elliptic curve. By combining these partial values with the Chinese Remainder Theorem (CRT) and the Sagemath pollard rho function (discrete_log_rho), a Bitcoin wallet can be restored within a timeframe of 5-15 minutes.

    For detailed walkthroughs, refer to the following resources:

  2. Overview of Esplora – Self-hosted blockchain explorer

    main

    Esplora is an open-source, self-hosted blockchain explorer developed by the Blockstream team. It allows users to independently deploy and manage their own blockchain browser, providing complete control over data and increased privacy.

    Key Capabilities:

    • Self-deployment: Run locally on your own server or virtual machine.
    • Multi-Blockchain Support: Supports Bitcoin, Litecoin, Liquid, and other Bitcoin-compatible blockchains.
    • Advanced Search: Powerful tools to find specific transactions, addresses, or blocks.
    • Data Visualization: Visualizes transaction graphs, block reward distributions, and other statistics.
    • Built-in API: Provides an API for integration with other applications to automate tasks and collect data.
  3. Overview of the VulnCipher Cryptanalytic Framework

    main

    VulnCipher is a scientific cryptanalytic framework designed to identify and analyze vulnerabilities in cryptographic implementations (including JavaScript libraries and embedded systems) susceptible to timing and side-channel attacks. It specifically targets three categories:

    • Insufficient entropy in key generation: Predictability due to weak PRNGs.
    • Signature processing manipulations: Bugs in ECDSA implementations.
    • Side-channel timing leaks: Variability in execution time of operations revealing key information.

    It is designed to be a reproducible research platform for security auditing and formal analysis.

  4. Overview of BTCDetect crypto tool

    main

    BTCDetect is software designed to recover lost Bitcoin wallets by exploiting vulnerabilities in cryptographic libraries, specifically targeting errors in SharpECC (a C# library for elliptic curve cryptography).

    Core Mechanism

    BTCDetect primarily relies on nonce generation errors during ECDSA digital signature creation. By analyzing multiple signatures generated with the same private key but flawed nonces, the software can calculate the private key itself.

    Capabilities

    Recovering a private key via BTCDetect grants full control over the associated Bitcoin address, enabling:

    • Creating and signing transactions to withdraw all funds.
    • Importing the key into standard wallets (Electrum, Bitcoin Core, MetaMask, etc.).
    • Taking complete control of the assets and hiding traces of compromise.
  5. Overview of Cryptographic Attacks and Private Key Recovery Methods

    main

    This section provides a curated list of documented cryptographic attacks and vulnerabilities that can lead to Bitcoin private key recovery or total network compromise. These attacks range from improper handling of private key material and nonce reuse to predictable Random Number Generators (PRNGs) and specific CVE vulnerabilities.

    Key attack categories include:

    • Nonce and PRNG Exploits: Attacks like the Pulse Rerun Attack (nonce reuse), Spectral Fountain Attack (unstable entropy/CVE-2025-27840), Resonance Thief Attack (repeating resonance in deterministic generators), and RNG Crystal Key Exploit (predictable generators like Randstorm in BitcoinJS or Libbitcoin's Mersenne Twister Bug).
    • Implementation and Code Vulnerabilities: KeyBlaze Attack (improper handling of key material), Master Key Attack (hardcoded private keys), and EllSwift Mirror Key Breach (CVE-2018-17096 and CVE-2023-39910).
    • Algorithmic and Mathematical Attacks: Linear Summoner Attack (LFSR generator vulnerability using the Berlekamp-Messi algorithm, CVE-2024-35202/CVE-2024-52922), Crystal Key Exposure Attack (predictability of SipHash and GCS filters), and Double Forge Attack (Bitcoin Core inflation vulnerability, CVE-2018-17144).
    • Transaction Manipulation: Resonance Twist Attack (changing TXID and witness data to double-spend).
  6. Overview of the RingSide Replay Attack (CVE-2023-39910)

    main

    The RingSide Replay Attack (codenamed “Milk Sad”) is a cryptanalytic exploit targeting Libbitcoin Explorer (versions 3.0.0–3.6.0). The vulnerability stems from the use of the Mersenne Twister-32 (MT19937) pseudorandom number generator initialized by system time, which reduces the entropy of generated seeds from the required 256 bits to only 32 bits.

    This limited entropy allows for the automated recovery of Bitcoin wallet private keys if the approximate creation time of the wallet is known. The attack has been used to compromise over 227,200 Bitcoin addresses and significant amounts of crypto assets across multiple chains (BTC, ETH, XRP, DOGE, SOL, LTC, BCH, ZEC).

  7. Overview of Coinbase Wallet Blockchain API integration

    main

    The Coinbase Wallet Blockchain API allows developers to build applications that interact directly with the Bitcoin network. Key capabilities include:

    • Data Access: Retrieve information about transactions, blocks, and addresses.
    • Asset Management: Enable users to send, receive, and track Bitcoin transactions.
    • Security: Leverage advanced encryption and direct blockchain verification for transparency.
    • dApp Development: Build decentralized applications (dApps) for DeFi, smart contracts, and supply chain management.

    To use the API, you must obtain an API key from your Coinbase account via the "API Keys" page in the "Settings" section.

  8. Overview of Cryptographic Vulnerabilities and Attacks

    main

    This repository contains research and documentation regarding various critical cryptographic vulnerabilities affecting digital signature infrastructure and Bitcoin wallets. The following attack vectors are documented:

    • Hash Race Poison Attack: A vulnerability in Bitcoin's transaction signing infrastructure caused by lack of thread safety in cryptographic hash caching, allowing attackers to inject values and potentially leak private keys.
    • Bitcoin Golden Onehash Heist (CVE-2025-29774): A digital signature forgery attack involving SIGHASH_SINGLE flag handling that allows signing transactions without the private key.
    • Bloodprint Attack (Secret Key Leakage Attack): A vulnerability involving private key leakage from memory.
    • STREAMLEAK ATTACK (Private Key Compromise Attack): An attack extracting secrets through the abuse of the overloaded << operator in C++ during serialization/output.
    • Oracle Whisper Attack (Private Key Compromise Attack): A Base58 decoding secret leak vulnerability where an attacker steals secret key bits via an 'oracle' injected into the I/O library.
    • Hex Dump Reveal Attack (CVE-2025-29774 and CWE-532): A 'Key Disclosure Attack' where vulnerabilities in logging private data reveal hexadecimal dumps containing secret keys.
    • Secret Capsule Attack (Predictable PRNG Seed Attack): Exploits predictable entropy in Mersenne Twister generators (e.g., CVE-2023-39910 in Libbitcoin Explorer).
    • Key Fountain Attack (Heap-based Buffer Overflow): Exploits buffer overflows in libbitcoin functions like splice or build_chunk to extract or replace wallet secrets.
  9. Overview of Insight REST API for Bitcoin

    main

    The Insight REST API is an open-source interface for interacting with the Bitcoin network. It allows developers to access core blockchain data and perform operations without running a full node locally.

    Key Capabilities:

    • Blocks & Transactions: Retrieve data about the latest blocks, specific blocks (by hash or height), and transaction details.
    • Address Management: Check balances, view received/sent transactions, and list associated addresses (inputs/outputs).
    • Transaction Operations: Send new transactions to the network and retrieve status/details of existing ones.
    • Network Statistics: Access data like overall balance, hashrate, and difficulty, as well as node (peer) status.

    Insight is built on Node.js and utilizes libraries like Bitcore to provide a robust interface for blockchain research and application development.

  10. Overview of Curve Anomalies in secpXXXk1 Elliptic Curves

    main
    This module focuses on the cryptanalysis of structural anomalies in base points of secpXXXk1 elliptic curves. It is designed to help ensure financial data security and protect secp256k1 (used in Bitcoin) against weak ECDSA signatures. The material includes practical modeling for Bitcoin cryptanalysis, which can be executed via Google Colab or by using the provided source code.
  11. Overview of GLV Endomorphism and Invalid Curve Attacks

    main

    This project provides a cryptanalytic analysis and demonstration of the security properties of the secp256k1 elliptic curve. It focuses on the distinction between mathematical curve design and implementation-level vulnerabilities.

    Key concepts covered include:

    • MOV Attack Resistance: Verifying resistance via the embedding degree $k$.
    • Pohlig–Hellman Resistance: Verifying the primality of the group order $n$.
    • GLV Endomorphism: Demonstrating the Gallant–Lambert–Vanstone (GLV) endomorphism which provides a Pollard rho speedup of approximately 2.
    • Invalid Curve Attacks: Demonstrating how the lack of point-membership verification allows an attacker to introduce low-order points on different curves to recover secret scalars using the Chinese Remainder Theorem (CRT).

    The project includes demo scripts designed for Google Colab to perform these audits and attacks.