### Quick Start Password Hashing with Passlib Context Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/narr/quickstart.rst Demonstrates the basic usage of the `custom_app_context` for hashing and verifying passwords. It shows how to import the context, hash a password, and verify a password against a hash. An optional example for admin accounts with stronger settings is also included. ```python from passlib.apps import custom_app_context as pwd_context # hash a password... hash = pwd_context.hash("somepass") # verifying a password... ok = pwd_context.verify("somepass", hash) # [optional] hashing a password for an admin account... # the custom_app_context is preconfigured so that # if the category is set to "admin" instead of None, # it uses a stronger setting of 80000 rounds: hash = pwd_context.hash("somepass", category="admin") ``` -------------------------------- ### Setup Python Project Source: https://github.com/demining/cryptodeeptools/blob/main/36SignatureMalleability/README.md This command initiates the setup process for a Python-based project, likely installing dependencies or configuring the environment. ```shell cd Broadcast-Bitcoin-Transaction/ !python setup.py ``` -------------------------------- ### Passlib Documentation Installation Guide (docs/install.rst) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt This reStructuredText file details how to install the passlib library, including prerequisites and different installation methods. ```rst docs/install.rst ``` -------------------------------- ### Hash and Verify Passwords with CryptContext Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/narr/quickstart.rst Provides examples of using a pre-configured CryptContext to hash a plaintext password and then verify if a given password matches the hash. It shows how to import the context and use its hash() and verify() methods. ```python >>> # import context from where you defined it... >>> from myapp.model.security import pwd_context >>> # hashing a password... >>> hash = pwd_context.hash("somepass") >>> hash '$pbkdf2-sha256$29000$BSBkLEXIeS9FKMW4F.I85w$SJMzqVU7fw49NDOJZHt2o9vKIfDUVM4cKlAD4MxIgD0' >>> # verifying a password... >>> pwd_context.verify("somepass", hash) True >>> pwd_context.verify("wrongpass", hash) False ``` -------------------------------- ### setup.py Usage Syntax Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Illustrates the general usage syntax for the setup.py script. It covers executing commands with options, getting help for specific commands, and listing all available commands. ```bash usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help ``` -------------------------------- ### Python Passlib Setup Script Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/passlib.egg-info/SOURCES.txt This snippet contains the main setup script for the Passlib library, responsible for package building, installation, and defining project metadata. ```Python passlib/_setup/__init__.py passlib/_setup/stamp.py ``` -------------------------------- ### Install PyOpenCL using APT Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/GPU_Acceleration.md Installs the pyOpenCL library using the APT package manager on Ubuntu systems. This is the simplest method if available packages are up-to-date. ```bash sudo apt install python3-pyopencl ``` -------------------------------- ### On-Start Script for Environment Setup Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/README.md A comprehensive script to set up the computing environment on a Vast.ai instance. It updates packages, installs Python and its dependencies, clones the CryptoDeepTools repository, installs required Python packages, and configures tmux. ```bash apt update apt install python3 python3-pip python3-dev python3-pyopencl nano mc git python3-bsddb3 -y apt install libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev libsecp256k1-dev -y git clone https://github.com/demining/CryptoDeepTools.git pip3 install -r ~/btcrecover/requirements-full.txt update-locale LANG=C.UTF-8 echo "set -g terminal-overrides \"xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@\"" > ~/.tmux.conf ``` -------------------------------- ### Python Package Build Commands (setup.py) Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Provides common commands for building and installing Python packages using the setup.py script. These commands manage the package lifecycle, including building distributable artifacts and installing them into the Python environment. ```python setup.py build will build the package underneath 'build/' ``` ```python setup.py install will install the package ``` -------------------------------- ### Check SageMath Version Source: https://github.com/demining/cryptodeeptools/blob/main/32DeserializeSignatureVulnerability/Deserialize_Signature_Vulnerability_Bitcoin.ipynb Displays the installed version of SageMath. This command is useful for confirming that SageMath has been correctly installed and to check compatibility with specific scripts. ```bash !sage -v ``` -------------------------------- ### Initialize Passlib CryptContext Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/narr/quickstart.rst Demonstrates how to import and initialize a CryptContext object, specifying supported hashing schemes, deprecation policies, and optional round counts for password hashing. ```python # # import the CryptContext class, used to handle all hashing... # from passlib.context import CryptContext # # create a single global instance for your app... # pwd_context = CryptContext( # Replace this list with the hash(es) you wish to support. # this example sets pbkdf2_sha256 as the default, # with additional support for reading legacy des_crypt hashes. schemes=["pbkdf2_sha256", "des_crypt"], # Automatically mark all but first hasher in list as deprecated. # (this will be the default in Passlib 2.0) deprecated="auto", # Optionally, set the number of rounds that should be used. # Appropriate values may vary for different schemes, # and the amount of time you wish it to take. # Leaving this alone is usually safe, and will use passlib's defaults. ## pbkdf2_sha256__rounds = 29000, ) ``` -------------------------------- ### Setup and Run QianshiBTC Source: https://github.com/demining/cryptodeeptools/blob/main/11QianshiBTC/README.md This snippet details the steps to set up and run the QianshiBTC tool. It involves cloning the repository, navigating to the directory, installing necessary build tools and libraries (g++, libgmp3-dev, libmpfr-dev), compiling the source code using 'make', and then executing the compiled program with a parameter (e.g., 40). ```shell git clone https://github.com/demining/CryptoDeepTools.git cd CryptoDeepTools/11QianshiBTC/ sudo apt-get install g++ -y sudo apt-get install libgmp3-dev libmpfr-dev -y make ./qianshiBTC 40 ``` -------------------------------- ### Install Passlib from Source Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/install.rst Installs Passlib directly from its source code using the setup.py script. ```bash python setup.py install ``` -------------------------------- ### Install Ruby 3.0 and Development Packages Source: https://github.com/demining/cryptodeeptools/blob/main/30GaussJacobiMethod/Gauss_Jacobi_Method_and_Tools_for_Extracting_Private_Key.ipynb This command installs the Ruby 3.0 development package and related libraries on a Debian-based system. It ensures that the necessary components for building and running Ruby applications are available. ```bash sudo apt-get update sudo apt-get install ruby3.0 ruby3.0-dev ruby3.0-doc ``` -------------------------------- ### Install GMP and MPFR Development Libraries (Ubuntu) Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Details the process of installing GMP and MPFR development libraries on an Ubuntu system. This involves using apt to fetch and install packages like libgmp-dev, libgmp3-dev, libgmpxx4ldbl, and libmpfr-dev. ```bash Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libgmp-dev libgmp3-dev libgmpxx4ldbl libmpfr-dev 0 upgraded, 4 newly installed, 0 to remove and 50 not upgraded. Need to get 620 kB of archives. After this operation, 2,996 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgmpxx4ldbl amd64 2:6.2.1+dfsg-3ubuntu1 [9,580 B] Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgmp-dev amd64 2:6.2.1+dfsg-3ubuntu1 [337 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgmp3-dev amd64 2:6.2.1+dfsg-3ubuntu1 [1,818 B] Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpfr-dev amd64 4.1.0-3build3 [271 kB] Fetched 620 kB in 0s (3,858 kB/s) debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 4.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Selecting previously unselected package libgmpxx4ldbl:amd64. (Reading database ... 123654 files and directories currently installed.) Preparing to unpack .../libgmpxx4ldbl_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libgmp-dev:amd64. Preparing to unpack .../libgmp-dev_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmp-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libgmp3-dev:amd64. Preparing to unpack .../libgmp3-dev_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmp3-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libmpfr-dev:amd64. Preparing to unpack .../libmpfr-dev_4.1.0-3build3_amd64.deb ... Unpacking libmpfr-dev:amd64 (4.1.0-3build3) ... Setting up libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Setting up libgmp-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Setting up libmpfr-dev:amd64 (4.1.0-3build3) ... Setting up libgmp3-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Processing triggers for libc-bin (2.35-0ubuntu3.4) ... /sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link ``` -------------------------------- ### Setup and Run Balance Checker (Shell) Source: https://github.com/demining/cryptodeeptools/blob/main/03CheckBitcoinAddressBalance/README.md This shell script automates the setup and execution process for checking Bitcoin address balances. It includes cloning the repository, installing dependencies, and running the main check script. ```bash git clone https://github.com/demining/CryptoDeepTools.git cd CryptoDeepTools/03CheckBitcoinAddressBalance/ sudo apt install python2-minimal wget https://bootstrap.pypa.io/pip/2.7/get-pip.py sudo python2 get-pip.py pip3 install -r requirements.txt chmod +x getbalance.sh ./getbalance.sh # All content will be saved in a file: "balance.json" ``` -------------------------------- ### Execute SageMath Relocation Script Source: https://github.com/demining/cryptodeeptools/blob/main/19SageMathGoogleColab/Install_SageMath_in_Google_Colab.ipynb This command runs the 'relocate-once.py' script using Python 3, which is likely responsible for setting up or relocating SageMath installation files to their correct paths. ```python !python3 relocate-once.py ``` -------------------------------- ### Install BitcoinLib from Source Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/bitcoinlib/docs/_static/manuals.install.rst Installs BitcoinLib from its source code repository. This involves cloning the repository, setting up a virtual environment, and installing development requirements. ```bash $ virtualenv -p python3 venv/bitcoinlib $ source venv/bitcoinlib/bin/activate $ git clone https://github.com/1200wd/bitcoinlib.git $ cd bitcoinlib $ pip install -r requirements-dev.txt ``` -------------------------------- ### Install PyOpenCL on Windows Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/GPU_Acceleration.md Installs PyOpenCL for GPU acceleration on Windows using pip. This command assumes you have downloaded the correct .whl file for your system architecture and Python version. ```bash pip3 install "pyopencl-2021.1.4+cl12-cp39-cp39-win_amd64.whl" ``` -------------------------------- ### Passlib README (README) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt The README file provides an introduction to the passlib project, including its purpose, installation instructions, and basic usage examples. It serves as the entry point for new users. ```markdown README ``` -------------------------------- ### Download and Setup Bitcoin ChatGPT Model (Python) Source: https://github.com/demining/cryptodeeptools/blob/main/38QuantumAttacks/BitcoinChatGPT_№7_Quantum_Attacks_Vulnerability_Algorithm.ipynb Downloads the model repository, extracts it, and installs the 'transformers' library. It then loads the DialoGPT-medium tokenizer and model from Hugging Face, moving the model to the CPU. ```python !wget https://bitcoinchatgpt.org/language-modeling/repositories.zip !unzip repositories.zip &> /dev/null !pip3 install transformers from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "microsoft/DialoGPT-medium" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) model = model.cpu() ``` -------------------------------- ### Execute Setup Script Source: https://github.com/demining/cryptodeeptools/blob/main/36SignatureMalleability/Signature_Malleability.ipynb Runs the setup.py script to install project dependencies, including libraries like zmq, ecdsa, and pycryptodome. This prepares the environment for running other scripts. ```shell !python setup.py ``` -------------------------------- ### Install BitcoinLib via Pip Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/bitcoinlib/docs/_static/manuals.install.rst Installs the BitcoinLib library using pip. This is the simplest method for installation. ```none $ pip install bitcoinlib ``` -------------------------------- ### Install Passlib from PyPi Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/install.rst Installs the Passlib library from the Python Package Index (PyPi) using pip. ```bash pip install passlib ``` -------------------------------- ### Execute bx Help Command Source: https://github.com/demining/cryptodeeptools/blob/main/29BitcoinUtilities/README.md This Python script shows how to execute the 'bx help' command and capture its output. It requires specifying the path to the bx executable and uses subprocess.check_output to get the results. ```python import subprocess # replace this with the path to your bx executable bx_path = "/path/to/bx" # command to execute command = [bx_path, "help"] # execute the command and capture the output output = subprocess.check_output(command) ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/install.rst Installs all necessary dependencies to build the documentation using pip. This command ensures that Sphinx and other required packages are available. ```shell pip install -e .[build_docs] ``` -------------------------------- ### Clone CryptoDeepTools Repository Source: https://github.com/demining/cryptodeeptools/blob/main/32DeserializeSignatureVulnerability/Deserialize_Signature_Vulnerability_Bitcoin.ipynb Clones the CryptoDeepTools repository from GitHub. This is the initial step to obtain the project's codebase and associated files. It requires Git to be installed. ```bash !git clone https://github.com/demining/CryptoDeepTools.git ``` -------------------------------- ### Clone and Setup CryptoDeepTools for Bitcoin Recovery Source: https://github.com/demining/cryptodeeptools/blob/main/09BitcoinWalletRecovery/README.md This section covers cloning the repository, navigating to the relevant directory, and installing necessary Python 2 dependencies. It ensures the environment is ready for the wallet recovery process. ```bash git clone https://github.com/demining/CryptoDeepTools.git cd CryptoDeepTools/09BitcoinWalletRecovery/ sudo apt install python2-minimal wget https://bootstrap.pypa.io/pip/2.7/get-pip.py sudo python2 get-pip.py pip2 install -r requirements.txt ``` -------------------------------- ### Navigate to Metasploit Framework Directory Source: https://github.com/demining/cryptodeeptools/blob/main/30GaussJacobiMethod/Gauss_Jacobi_Method_and_Tools_for_Extracting_Private_Key.ipynb Changes the current working directory to the root directory of the Metasploit Framework installation. This is a common starting point for many Metasploit-related operations, including module management and tool execution. ```shell cd content/Smart-Transformers/metasploit-framework/ ``` -------------------------------- ### Build Documentation with Sphinx Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/install.rst Executes the Sphinx build process using the setup.py script. This command generates the HTML documentation from the source files. ```python python setup.py build_sphinx ``` -------------------------------- ### Hash and Verify Passwords with CryptContext Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/narr/quickstart.rst Shows how to use an initialized CryptContext object to hash a plaintext password and verify if a given password matches a stored hash. This is a fundamental security operation for user authentication. ```python >>> # import context from where you defined it... >>> from myapp.model.security import pwd_context >>> # hashing a password... >>> hash = pwd_context.hash("somepass") >>> hash '$pbkdf2-sha256$29000$BSBkLEXIeS9FKMW4F.I85w$SJMzqVU7fw49NDOJZHt2o9vKIfDUVM4cKlAD4MxIgD0' >>> # verifying a password... >>> pwd_context.verify("somepass", hash) True >>> pwd_context.verify("wrongpass", hash) False ``` -------------------------------- ### Test BTCRecover Installation Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/README.md Execute the installation test script to ensure all BTCRecover features are ready for use. This script verifies the installation and dependencies. ```bash python3 run-all-tests.py -vv ``` -------------------------------- ### Passlib Setup Script (setup.py) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt The setup.py file is used for packaging and distributing the passlib library. It defines metadata, dependencies, and build instructions for the project. ```python setup.py ``` -------------------------------- ### setup.py Global and Information Options Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Lists global options and information display options for the setup.py script. Global options control the overall behavior of the script, while information options allow querying metadata about the package without performing actions. ```python Global options: --verbose (-v) run verbosely (default) --quiet (-q) run quietly (turns verbosity off) --dry-run (-n) don't actually do anything --help (-h) show detailed help message --no-user-cfg ignore pydistutils.cfg in your home directory --command-packages list of packages that provide distutils commands ``` ```python Information display options (just display information, ignore any commands) --help-commands list all available commands --name print package name --version (-V) print package version --fullname print - --author print the author's name --author-email print the author's email address --maintainer print the maintainer's name --maintainer-email print the maintainer's email address --contact print the maintainer's name if known, else the author's --contact-email print the maintainer's email address if known, else the author's --url print the URL for this package --license print the license of the package --licence alias for --license --description print the package description --long-description print the long package description --platforms print the list of platforms --classifiers print the list of classifiers --keywords print the list of keywords --provides print the list of packages/modules provided --requires print the list of packages/modules required --obsoletes print the list of packages/modules made obsolete ``` -------------------------------- ### Run BitcoinLib Tests Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/bitcoinlib/docs/_static/manuals.install.rst Executes the unit tests for BitcoinLib to verify that the installation and dependencies are correctly set up. ```bash python setup.py test ``` -------------------------------- ### Kangaroo Input File Example Source: https://github.com/demining/cryptodeeptools/blob/main/06KangarooJeanLucPons/README.md Provides a concrete example of the input file format, showing the structure for start and end ranges, followed by sample public keys. ```text Start range End range Key #1 Key #2 ... ex 49dccfd96dc5df56487436f5a1b18c4f5d34f65ddb48cb5e0000000000000000 49dccfd96dc5df56487436f5a1b18c4f5d34f65ddb48cb5effffffffffffffff 0459A3BFDAD718C9D3FAC7C187F1139F0815AC5D923910D516E186AFDA28B221DC994327554CED887AAE5D211A2407CDD025CFC3779ECB9C9D7F2F1A1DDF3E9FF8 0335BB25364370D4DD14A9FC2B406D398C4B53C85BE58FCC7297BD34004602EBEC ``` -------------------------------- ### Install Passlib with Optional Extras Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/install.rst Installs Passlib along with specific optional libraries for enhanced functionality, such as Argon2, BCrypt, or TOTP support. ```bash pip install passlib[argon2] ``` ```bash pip install passlib[bcrypt] ``` ```bash pip install passlib[totp] ``` -------------------------------- ### List Directory Contents Source: https://github.com/demining/cryptodeeptools/blob/main/19SageMathGoogleColab/Install_SageMath_in_Google_Colab.ipynb The 'ls' command lists all files and directories within the current directory. This is useful for verifying the extraction and identifying available SageMath components. ```bash ls ``` -------------------------------- ### Hugging Face Transformers Python Package Installation Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Details the successful installation of the 'transformers' Python package and its dependencies, including 'filelock', 'huggingface-hub', 'numpy', 'packaging', 'pyyaml', 'regex', 'requests', 'tokenizers', 'safetensors', and 'tqdm'. It also lists the versions of each installed package. ```bash Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.47.1) Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.16.1) Requirement already satisfied: huggingface-hub<1.0,>=0.24.0 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.27.0) Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (1.26.4) Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers) (24.2) Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (6.0.2) Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2024.11.6) Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers) (2.32.3) Requirement already satisfied: tokenizers<0.22,>=0.21 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.21.0) Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.4.5) Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers) (4.67.1) Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.24.0->transformers) (2024.10.0) Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.24.0->transformers) (4.12.2) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.4.0) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.10) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2.2.3) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2024.12.14) ``` -------------------------------- ### Install MPFR and GMP development libraries (Ubuntu) Source: https://github.com/demining/cryptodeeptools/blob/main/30GaussJacobiMethod/Gauss_Jacobi_Method_and_Tools_for_Extracting_Private_Key.ipynb Installs the development libraries for MPFR and GMP on Ubuntu systems. These libraries are essential for mathematical computations and are often required by scientific and cryptographic tools. The installation process involves fetching packages from the Ubuntu archive. ```bash Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpfr-dev amd64 4.1.0-3build3 [271 kB] Fetched 620 kB in 1s (679 kB/s) debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 4.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Selecting previously unselected package libgmpxx4ldbl:amd64. (Reading database ... 121773 files and directories currently installed.) Preparing to unpack .../libgmpxx4ldbl_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libgmp-dev:amd64. Preparing to unpack .../libgmp-dev_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmp-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libgmp3-dev:amd64. Preparing to unpack .../libgmp3-dev_2%3a6.2.1+dfsg-3ubuntu1_amd64.deb ... Unpacking libgmp3-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Selecting previously unselected package libmpfr-dev:amd64. Preparing to unpack .../libmpfr-dev_4.1.0-3build3_amd64.deb ... Unpacking libmpfr-dev:amd64 (4.1.0-3build3) ... Setting up libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Setting up libgmp-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Setting up libmpfr-dev:amd64 (4.1.0-3build3) ... Setting up libgmp3-dev:amd64 (2:6.2.1+dfsg-3ubuntu1) ... Processing triggers for libc-bin (2.35-0ubuntu3.4) ... ``` -------------------------------- ### Run btcrecover with help option Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/TUTORIAL.md Running btcrecover with the --help option displays a summary of all available command-line options. ```bash python btcrecover.py --help ``` -------------------------------- ### Download and Extract SageMath Archive Source: https://github.com/demining/cryptodeeptools/blob/main/19SageMathGoogleColab/Install_SageMath_in_Google_Colab.ipynb This snippet downloads the SageMath tarball using wget and then extracts its contents using the tar command. It's essential for setting up the SageMath environment. ```python !wget https://cryptodeeptech.ru/sage-9.3-Ubuntu_20.04-x86_64.tar.bz2 !tar -xf sage-9.3-Ubuntu_20.04-x86_64.tar.bz2 ``` -------------------------------- ### Install SageMath and gmpy2 Dependencies Source: https://github.com/demining/cryptodeeptools/blob/main/32DeserializeSignatureVulnerability/Deserialize_Signature_Vulnerability_Bitcoin.ipynb Updates the package list and installs SageMath and the python3-gmpy2 library. These are essential dependencies for running cryptographic analysis scripts, particularly those involving advanced mathematical computations. ```bash !sudo apt-get update !sudo apt-get install -y python3-gmpy2 !sudo apt-get install sagemath ``` -------------------------------- ### Install python-progressbar from PyPI Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/progressbar/README.md Installs the python-progressbar library using pip from the Python Package Index (PyPI). This is the standard method for installing Python packages. ```bash pip install progressbar33 ``` -------------------------------- ### Navigate to SageMath Directory Source: https://github.com/demining/cryptodeeptools/blob/main/19SageMathGoogleColab/Install_SageMath_in_Google_Colab.ipynb This command changes the current directory to the 'SageMath' folder, which is necessary to access and run SageMath executables and scripts. ```bash cd SageMath/ ``` -------------------------------- ### Test BTCRecover Installation Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/INSTALL.md Runs all automated tests for BTCRecover to verify a successful installation. This command checks if Python and all installed libraries are functioning correctly, ensuring the program is ready for use. The test process may take a few minutes to complete. ```shell python run-all-tests.py -vv ``` -------------------------------- ### Create a Bitcoin Key from WIF Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/bitcoinlib/docs/bitcoinlib-10-minutes.ipynb Shows how to instantiate a Key object from a Wallet Import Format (WIF) string and then print the associated Bitcoin address. ```python from bitcoinlib.keys import Key wif = 'KyAoQkmmoAgdC8YXamgpqFb2R8j6g5jiBnGdJo62aDJCxstboTqS' k = Key(wif) print(k.address()) ``` -------------------------------- ### Install ECPy library for cryptographic operations Source: https://github.com/demining/cryptodeeptools/blob/main/32DeserializeSignatureVulnerability/Deserialize_Signature_Vulnerability_Bitcoin.ipynb This command installs the ECPy library using pip3. ECPy is a Python library for Elliptic Curve Cryptography, essential for performing advanced cryptographic operations required in the project. ```bash !pip3 install ECPy ``` -------------------------------- ### Setup VanityGen PLUS Dependencies Source: https://github.com/demining/cryptodeeptools/blob/main/12CoingeckoAgentFtpupload/Coingecko_VanityGen.ipynb Installs necessary libraries like libcrypto and libc6 required for VanityGen PLUS. It downloads .udeb packages and installs them using dpkg, followed by cleanup. Finally, it extracts a binary archive containing the VanityGen executable. ```python #@title Setup #@markdown VanityGen PLUS needs libcrypto that depends on libc6. This step fetches #@markdown required packages and installs them. !wget -qnc https://raw.githubusercontent.com/dreamscached/vanitygen-colab/master/res/libc6-udeb_2.24-11+deb9u4_amd64.udeb !dpkg -i libc6-udeb_2.24-11+deb9u4_amd64.udeb && rm libc6-udeb_2.24-11+deb9u4_amd64.udeb !wget -qnc https://raw.githubusercontent.com/dreamscached/vanitygen-colab/master/res/libcrypto1.0.2-udeb_1.0.2u-1~deb9u1_amd64.udeb !dpkg -i libcrypto1.0.2-udeb_1.0.2u-1~deb9u1_amd64.udeb && rm libcrypto1.0.2-udeb_1.0.2u-1~deb9u1_amd64.udeb !curl -sL 'https://raw.githubusercontent.com/dreamscached/vanitygen-colab/master/res/linux-binary.tar.gz' | tar xzv ``` -------------------------------- ### Install ECPy from Source Tarball Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/ecpy/README.rst This sequence of commands outlines how to install ECPy when distributed as a source tarball. It involves downloading the tarball, extracting its contents using `tar`, and then running the installation script `setup.py`. This method is useful for installing from local files or custom builds. ```bash tar xzvf ECPy-M.m.tar.gz python3 setup.py install ``` -------------------------------- ### Install Ruby Gems for Crypto and Bitcoin Source: https://github.com/demining/cryptodeeptools/blob/main/30GaussJacobiMethod/Gauss_Jacobi_Method_and_Tools_for_Extracting_Private_Key.ipynb This series of commands installs several Ruby gems essential for cryptographic operations and Bitcoin-related functionalities. It includes gems for Bitcoin, ECDSA, Base58 encoding, general crypto utilities, and configuration hashing. ```python !gem install bitcoin-ruby !gem install ecdsa !gem install base58 !gem install crypto !gem install config-hash -v 0.9.0 ``` -------------------------------- ### Bitcoin OP_CHECKMULTISIG Script Example Source: https://github.com/demining/cryptodeeptools/blob/main/41DigitalSignatureForgeryAttack/README.md This example demonstrates a typical script using OP_CHECKMULTISIG for a 2-of-3 multi-signature setup. It specifies the number of public keys and the required signature threshold. The scriptSig would contain the signatures and the public keys. ```bitcoin_script 023927... 03d2c0... 03ec01... 3 OP_CHECKMULTISIG ``` -------------------------------- ### Passlib Documentation Context Tutorial (docs/narr/context-tutorial.rst) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt This file provides a tutorial on using the context management features of passlib, explaining how to configure and use different hashing contexts. ```rst docs/narr/context-tutorial.rst ``` -------------------------------- ### Broadcast Bitcoin Transaction (Python) Source: https://github.com/demining/cryptodeeptools/blob/main/29BitcoinUtilities/README.md Serializes and prints a Bitcoin transaction in hexadecimal format for broadcasting over the Bitcoin network. This is an example and should be used with caution. ```Python tx_hex = encode(tx.serialize()) print("Bitcoin Transaction: ", tx_hex) ``` -------------------------------- ### Get System IP Address Source: https://github.com/demining/cryptodeeptools/blob/main/25MilkSadVulnerability/Vulnerability_in_Libbitcoin_Explorer_3_x_library.ipynb Retrieves and displays the IP addresses configured on the system's network interfaces. This is useful for network reconnaissance and understanding connectivity. ```python !ip addr ``` ```python !hostname -I ``` -------------------------------- ### Bitcoin Key Management and Signing with bitcoin-utils Source: https://github.com/demining/cryptodeeptools/blob/main/27PaddingOracleAttackonWalletdat/Padding_Oracle_Attack_on_Wallet_dat.ipynb This script demonstrates how to set up the Bitcoin network, generate private and public keys from a WIF, derive the corresponding address, and sign/verify a message. It requires the bitcoin-utils library. ```python # https://github.com/demining/CryptoDeepTools.git # INSTALL: # pip3 install bitcoin-utils from bitcoinutils.setup import setup from bitcoinutils.keys import PrivateKey, PublicKey def main(): setup("mainnet") priv = PrivateKey.from_wif('KyAqkBWTbeR3w4RdzgT58R5Rp7RSL6PfdFDEkJbwjCcSaRgqg3Vz') print("\nPrivate key WIF:", priv.to_wif(compressed=True)) pub = priv.get_public_key() print("Public key:", pub.to_hex(compressed=True)) address = pub.get_address() print("Address:", address.to_string()) print("Hash160:", address.to_hash160()) print("\n--------------------------------------\n") message = "CryptoDeepTech" signature = priv.sign_message(message) assert signature is not None print("The message to sign:", message) print("The signature is:", signature) if PublicKey.verify_message(address.to_string(), signature, message): print("The signature is valid!") else: print("The signature is NOT valid!") if __name__ == "__main__": main() ``` -------------------------------- ### Passlib Documentation Hash Tutorial (docs/narr/hash-tutorial.rst) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt This file offers a tutorial on utilizing the various hashing algorithms supported by passlib, demonstrating how to hash and verify passwords. ```rst docs/narr/hash-tutorial.rst ``` -------------------------------- ### Elliptic Curve Cryptography Setup Source: https://github.com/demining/cryptodeeptools/blob/main/39BluetoothAttacks/BitcoinChatGPT_№8_Bluetooth_Attacks_Vulnerability_Algorithm.ipynb Installs the pycryptodome library and imports necessary modules for Elliptic Curve Cryptography (ECC). Note: PyCryptodome does not directly support secp256k1 parameters. ```python !pip install pycryptodome from hashlib import sha256 from Crypto.PublicKey import ECC from Crypto.Signature import DSS from Crypto.Hash import SHA256 import secrets # Elliptic curve parameters secp256k1 # PyCryptodome does not provide a convenient way to directly specify the parameters of the secp256k1 curve. # Therefore, we will use the standard ECC curve. ``` -------------------------------- ### Clone Repository and Setup Environment Source: https://github.com/demining/cryptodeeptools/blob/main/15RowhammerAttack/README.md These commands are used to clone the CryptoDeepTools repository, navigate to the Rowhammer attack directory, install dependencies, and prepare the environment for the attack. ```shell git clone https://github.com/demining/CryptoDeepTools.git cd CryptoDeepTools/15RowhammerAttack/ ls sudo apt install python2-minimal wget https://bootstrap.pypa.io/pip/2.7/get-pip.py sudo python2 get-pip.py pip2 install -r requirements.txt ``` -------------------------------- ### Example Usage of Discrete Logarithm in Python Source: https://github.com/demining/cryptodeeptools/blob/main/30GaussJacobiMethod/Gauss_Jacobi_Method_and_Tools_for_Extracting_Private_Key.ipynb Demonstrates the usage of the `discrete_logarithm` function with sample values for base 'a', target 'b', and modulus 'm'. Prints the computed discrete logarithm. ```python a = 5 b = 17 m = 19 result = discrete_logarithm(a, b, m) print(result) # Output: 2 ``` -------------------------------- ### Passlib Setup Configuration (setup.cfg) Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib.egg-info/SOURCES.txt The setup.cfg file may contain additional configuration options for setuptools, such as package metadata or build options, complementing the setup.py file. ```ini setup.cfg ``` -------------------------------- ### Loading CryptContext from Path Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/narr/context-tutorial.rst Initializes a new CryptContext instance from a configuration file. ```APIDOC ## POST /context/from_path ### Description Creates a new CryptContext instance by loading configuration from a specified file path. The file should contain configuration in the INI format. ### Method POST ### Endpoint /context/from_path ### Parameters #### Request Body - **file_path** (string) - Required - The path to the configuration file. ### Request Example ```json { "file_path": "/path/to/your/config.ini" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the context has been loaded. - **context_id** (string) - An identifier for the newly created context (if applicable). #### Response Example ```json { "message": "CryptContext loaded from path successfully.", "context_id": "ctx_def456" } ``` ``` -------------------------------- ### Output of ls -S Command Source: https://github.com/demining/cryptodeeptools/blob/main/37DiscreteLogarithm/Joux_Lercier_Vulnerability_Algorithm_and_Tools_for_Extracting_Private_Key.ipynb Displays the output of the 'ls -S' command, listing files and directories sorted by size. It includes executable files for various algorithms (e.g., Shors_Algorithm, Schnorr_Signature_Algorithm) and multiple README files in different languages, along with project files like setup.py. ```text SMART_IDENTIFY* README_ru.md Special_Number_Field_Sieve_Algorithm* README_vi.md Trial_Division_Algorithm* README_ja.md Shors_Algorithm* README_fr.md Schnorr_Signature_Algorithm* README_de.md Tate_Pairing_Algorithm* README_pt-br.md Vergne_Algorithm* README.md Williams_P1_Factorization_Algorithm* README_ko.md Semaev_Smart_Algorithm* README_es.md Taurin_Algorithm* README_zh-hant.md Verheul_Algorithm* README_zh-hans.md Silvermans_Algorithm* awesome-transformers.md Schoofs_Algorithm* CONTRIBUTING.md Shanks_Baby_Step_Giant_Step_Algorithm* ISSUES.md Pohlig_Hellman_Algorithm* setup.py ``` -------------------------------- ### Uncommon Leetspeak Typos Map Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/Typos_Quick_Start_Guide.md This typos-map file is similar to leet-map.txt but includes less common leetspeak replacements, offering broader coverage for unusual substitutions. ```text leet-uncommon-map.txt ``` -------------------------------- ### Initialize SageMath Shell Environment Source: https://github.com/demining/cryptodeeptools/blob/main/19SageMathGoogleColab/Install_SageMath_in_Google_Colab.ipynb This command executes the SageMath shell initialization script. The '-sh' flag typically sets up the environment variables and paths required for using SageMath commands interactively. ```bash !./sage -sh ``` -------------------------------- ### Python Passlib Setup Configuration Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/passlib.egg-info/SOURCES.txt This snippet includes Python files related to the setup and packaging of the Passlib library, such as `setup.py` and `setup.cfg`, which define build configurations and metadata. ```Python setup.py setup.cfg ``` -------------------------------- ### Create Keys for Different Networks and Encodings Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/bitcoinlib/docs/bitcoinlib-10-minutes.ipynb Demonstrates creating a Key object for the Litecoin network and also shows how to generate a bech32 encoded address, commonly used in Bitcoin's segwit. ```python from bitcoinlib.keys import Key k = Key(network='litecoin') print(k.address()) print(k.address(encoding='bech32')) ``` -------------------------------- ### Combined Anchors and Required Tokens Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/tokenlist_file.md An example combining the '+' requirement with beginning anchors ('^'), indicating that a token must be present and must also appear at the start of the password. ```text Cairo Beetlejuice beetlejuice Betelgeuse betelgeuse + ^Hotel_california ^hotel_california ``` -------------------------------- ### Leetspeak Typos Map Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/Typos_Quick_Start_Guide.md This typos-map file tests password variations by replacing letters with their common leetspeak equivalents. It's useful for passwords that might use such substitutions. ```text leet-map.txt ``` -------------------------------- ### Specify backend at runtime Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/eth_hash/docs/quickstart.rst Shows how to explicitly specify a hashing backend (pysha3) at runtime by importing the backend and passing it to the Keccak256 class constructor. This provides direct control over which backend is used for hashing. ```python from lib.eth_hash.backends import pysha3 from lib.eth_hash import Keccak256 keccak = Keccak256(pysha3) keccak(b'') ``` -------------------------------- ### Get OpenCL Device Info Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/docs/GPU_Acceleration.md Retrieves a list of OpenCL devices and their maximum work-group sizes. This command is essential for understanding your hardware's capabilities before manually setting the workgroup size. ```bash cryptodeeptools --opencl-info ``` -------------------------------- ### Loading CryptContext configuration from a file path Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/narr/context-tutorial.rst Demonstrates creating a CryptContext instance by loading its configuration from a specified file path. This enables external configuration management. ```python >>> myctx3 = CryptContext.from_path("/some/path/on/local/system") ``` -------------------------------- ### CryptContext Initialization Source: https://github.com/demining/cryptodeeptools/blob/main/17BTCRecoverCryptoGuide/lib/passlib/docs/narr/context-tutorial.rst Demonstrates how to initialize the CryptContext with specific hashing schemes and mark certain schemes as deprecated. ```APIDOC ## CryptContext Initialization ### Description Initializes a password hashing context, specifying allowed schemes and identifying which schemes are deprecated. Deprecated schemes may still be used for verification but will be flagged for update. ### Method Constructor ### Endpoint N/A (Class Initialization) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from passlib.context import CryptContext myctx = CryptContext( schemes=["sha256_crypt", "md5_crypt", "des_crypt"], deprecated=["md5_crypt", "des_crypt"] ) ``` ### Response #### Success Response (200) N/A (Object instantiation) #### Response Example N/A ``` -------------------------------- ### Get Information from a Work File Source: https://github.com/demining/cryptodeeptools/blob/main/06KangarooJeanLucPons/README.md Retrieves and displays detailed information about a saved work file, including version, DP bits, start and stop points, key, counts, timings, and hash table statistics. ```shell Kangaroo.exe -winfo save.work ``` -------------------------------- ### Display msfvenom Help (Shell) Source: https://github.com/demining/cryptodeeptools/blob/main/26BitcoinLightningWalletVulnerability/Bitcoin_Lightning_Wallet_Vulnerability.ipynb This command displays the help information for msfvenom, a Metasploit Framework tool for generating payloads. It shows available options for payload creation, encoding, and output formatting. ```shell !./msfvenom -help ```