### Build bitlocker_rpc Project Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Instructions for building the bitlocker_rpc project on Linux/macOS and Windows, including a manual nvcc compilation command. Ensure you have the CUDA toolkit installed and adjust SM for your specific GPU. ```bash # Linux/macOS build cd ./scripts/build.sh ``` ```powershell # Windows build (PowerShell) cd scripts\build.bat ``` ```bash # Manual nvcc build (adjust SM for your GPU) nvcc -gencode arch=compute_75,code=sm_75 -I src -I src/include -rdc=true -O3 \ -o build/bitlocker_rpc \ src/bitlocker_rpc.cu src/hash_parser.cpp src/kernel.cu src/password_gen.cu src/utils.cpp \ src/crypto/aes_ccm.cu src/crypto/aes128.cu src/crypto/aes256.cu ``` -------------------------------- ### bitlocker_rpc Command Line Interface Help Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Displays the full help and usage information for the bitlocker_rpc executable, outlining available options for controlling GPU parameters, attack modes, and output. ```bash # Display full help and usage information ./build/bitlocker_rpc -h ``` -------------------------------- ### Run bitlocker_rpc with Hash String or File Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Demonstrates how to run the bitlocker_rpc tool using either an inline hash string or a hash read from a file. This involves specifying thread and block counts, and providing the hash data. ```bash # Example: Run with inline hash string ./build/bitlocker_rpc -t 512 -b 2048 "bitlocker$1$32$abcd1234....$100000$12$aabbcc...$48$encrypted_hex..." ``` ```bash # Example: Run with hash from file ./build/bitlocker_rpc -f hash.txt -t 512 -b 1024 ``` -------------------------------- ### Display Progress and Handle User Input (Bash) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt This snippet demonstrates how the BitLocker RPC tool displays real-time progress during brute-force recovery operations. It shows metrics like candidates tested, speed, elapsed time, progress percentage, GPU utilization, and estimated time remaining. It also illustrates how users can gracefully exit the operation by pressing 'q'. ```bash # During operation, the tool displays: # - Candidates tested # - Speed (candidates/second) # - Elapsed time # - Progress percentage (when keyspace is known) # - GPU utilization # - Estimated time remaining # Sample output during run: # BitLocker RPC - GPU Brute Force Recovery # ---------------------------------------- # Mask: ??????-??????-123456-??????-??????-??????-??????-?????? | Estimated keyspace: 5.47e29 # (Q)uit # # Candidates:1234567890 | Speed:5800000000 c/s | Elapsed:00:03:32 | Progress:0.00% | Util:98% | ETA:999:59:59 # Press 'q' during operation to gracefully exit # Exit the program (y/n)? y # Exiting gracefully... ``` -------------------------------- ### Recover and Write Password (Bash) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt This code snippet shows how to initiate a full attack using the BitLocker RPC tool and how the tool indicates a successful password recovery. It includes the command to run the attack, the expected success message, and how to view the recovered password from the output file. The recovered password can then be used to unlock the BitLocker drive. ```bash # Run full attack ./build/bitlocker_rpc -f hash.txt -t 512 -b 2048 -o recovered.txt # On success, output shows: # Password found and written to recovered.txt # Check recovered.txt: cat recovered.txt # Password found: 123456-789012-345678-901234-567890-123456-789012-345678 # Use the recovered password to unlock the BitLocker drive ``` -------------------------------- ### Display Help for BitLocker RPC Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/README.md This command shows how to display the help message for the bitlocker_rpc executable on Windows. It lists available command-line options and their descriptions. ```powershell build\bitlocker_rpc.exe -h ``` -------------------------------- ### Build Tests on Windows Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/CONTRIBUTING.md Compiles the test binaries on Windows using a batch script. After execution, test executables can be found and run within the build directory. ```powershell scripts\build_test.bat ``` -------------------------------- ### Build bitlocker_rpc on Windows Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/CONTRIBUTING.md Builds the bitlocker_rpc executable and test binaries on Windows using a provided batch script. Assumes the repository root is the current directory. ```powershell cd scripts\build.bat ``` -------------------------------- ### Manual Build with nvcc for BitLocker RPC Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/README.md This command demonstrates a manual build process for the bitlocker_rpc project using the nvcc compiler. It specifies CUDA architecture, include paths, optimization levels, output file, and source files, including CUDA kernels and C++ source files. ```bash nvcc -gencode arch=compute_75,code=sm_75 -I src -I src/include -rdc=true -O3 \ -o build/bitlocker_rpc \ src/bitlocker_rpc.cu src/hash_parser.cpp src/kernel.cu src/password_gen.cu src/utils.cpp \ src/crypto/aes_ccm.cu src/crypto/aes128.cu src/crypto/aes256.cu ``` -------------------------------- ### Benchmark bitlocker_rpc Password Generation Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Runs the bitlocker_rpc tool in benchmark mode to test password generation throughput without full cryptographic verification. This is useful for GPU tuning and performance assessment. Custom thread and block configurations can be specified. ```bash # Run benchmark with custom thread/block configuration ./build/bitlocker_rpc --benchmark -t 256 -b 1024 ``` -------------------------------- ### Build BitLocker RPC using Platform Scripts (Linux/macOS) Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/README.md This script automates the build process for the bitlocker_rpc project on Linux or macOS using bash. It navigates to the repository root and executes the build script. ```bash cd scripts/build.sh ``` -------------------------------- ### Configure Multi-GPU Operation in bitlocker_rpc Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Explains how to configure bitlocker_rpc to distribute workloads across multiple NVIDIA GPUs for increased throughput. This includes using all available GPUs by default or specifying specific GPUs by their IDs. ```bash # Use all available GPUs (default) ./build/bitlocker_rpc -f hash.txt -t 512 -b 2048 ``` ```bash # Use specific GPUs by ID ./build/bitlocker_rpc -d 0,1 -f hash.txt -t 512 -b 2048 ``` ```bash # Use only GPU 0 ./build/bitlocker_rpc -d 0 -f hash.txt -t 512 -b 2048 ``` -------------------------------- ### Run Benchmarks on Windows Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/CONTRIBUTING.md Executes the bitlocker_rpc program in benchmark mode on Windows. This mode measures throughput without performing full cryptographic verification. Parameters for threads and blocks can be specified. ```bash build\bitlocker_rpc.exe -B -t -b ``` -------------------------------- ### Build bitlocker_rpc on Linux/macOS Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/CONTRIBUTING.md Compiles the bitlocker_rpc executable on Linux/macOS using nvcc. Requires CUDA Toolkit, a C++ toolchain, and nvcc in the PATH. This command specifies compute capabilities and optimization flags. ```bash cd nvcc -gencode arch=compute_75,code=sm_75 -I src -I src/include -rdc=true -O3 \ -o build/bitlocker_rpc \ src/bitlocker_rpc.cu src/hash_parser.cpp src/kernel.cu src/password_gen.cu src/utils.cpp \ src/crypto/aes_ccm.cu src/crypto/aes128.cu src/crypto/aes256.cu ``` -------------------------------- ### Build BitLocker RPC using Platform Scripts (Windows) Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/README.md This script automates the build process for the bitlocker_rpc project on Windows using PowerShell. It navigates to the repository root and executes the build script. ```powershell cd scripts\build.bat ``` -------------------------------- ### Run BitLocker RPC in Benchmark Mode Source: https://github.com/caveman8080/bitlocker_rpc/blob/main/README.md This command executes the bitlocker_rpc program in benchmark-only mode on Windows. It uses specific thread and block counts for GPU tuning, allowing measurement of password generation throughput without full cryptographic verification. ```powershell build\bitlocker_rpc.exe -B -t 128 -b 128 ``` -------------------------------- ### Parse BitLocker Hash Strings (C++) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Parses BitCracker-formatted hash strings into a structured `HashParams` object. This object contains the salt, iteration count, nonce (IV), and encrypted data required for the brute-force process. It also includes a utility for converting hex strings to byte vectors. ```cpp #include "include/hash_parser.h" // HashParams structure struct HashParams { std::vector salt; // PBKDF2 salt int iterations; // PBKDF2 iteration count (typically 100,000) std::vector iv; // AES-CCM nonce/IV std::vector encrypted_data; // Encrypted VMK data }; // Parse hash string std::string hash = "bitlocker$1$32$aabbccdd...$100000$12$112233...$48$encrypted..."; HashParams params = parse_hash(hash); // Access parsed components printf("Salt length: %zu\n", params.salt.size()); // 32 printf("Iterations: %d\n", params.iterations); // 100000 printf("IV length: %zu\n", params.iv.size()); // 12 printf("Encrypted length: %zu\n", params.encrypted_data.size()); // 48 // Hex string conversion utility std::vector bytes = hex_to_bytes("deadbeef"); // bytes = {0xde, 0xad, 0xbe, 0xef} ``` -------------------------------- ### Generate BitLocker Passwords (CUDA C++) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Generates BitLocker recovery passwords based on an index, ensuring each 6-digit group is divisible by 11 to meet checksum constraints. The function operates on the device and outputs a 56-byte password string. ```cpp // Each 6-digit group must be divisible by 11 // Valid values per group: 0, 11, 22, ..., 999979 (90,909 possibilities) // Total keyspace without mask: 90909^8 = ~4.3e39 combinations // Device function signature __device__ void generate_password(unsigned long long index, unsigned char* password); // Example: Index 0 generates "000000-000000-000000-000000-000000-000000-000000-000000" // Example: Index 1 generates "000000-000000-000000-000000-000000-000000-000000-000011" // Password format: 48 digits + 7 hyphens + null terminator = 56 bytes ``` -------------------------------- ### Perform Mask Attack with bitlocker_rpc Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Utilizes the mask attack mode in bitlocker_rpc to target partial passwords when some groups are known. This significantly reduces the keyspace. The mask format is 55 characters, with '?' for unknown digits and known groups divisible by 11. ```bash # Example: Third group known as 123456 ./build/bitlocker_rpc -f hash.txt -m "??????-??????-123456-??????-??????-??????-??????-??????" ``` ```bash # Example: First and last groups known ./build/bitlocker_rpc -f hash.txt -m "111111-??????-??????-??????-??????-??????-??????-999999" ``` -------------------------------- ### PBKDF2-HMAC-SHA256 Key Derivation (CUDA C++) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Implements the PBKDF2-HMAC-SHA256 key derivation function optimized for GPU execution. It offers both a standard per-thread version and a warp-cooperative version that leverages shared memory for improved performance. ```cpp #include "crypto/pbkdf2.h" // Standard PBKDF2 (per-thread) __device__ void pbkdf2_hmac_sha256( const unsigned char* pass, size_t passlen, const unsigned char* salt, size_t saltlen, int iterations, unsigned char* dk, size_t dklen ); // Warp-cooperative PBKDF2 (shared memory optimization) __device__ void pbkdf2_hmac_sha256_warp( const unsigned char* pass, size_t passlen, const unsigned char* salt, size_t saltlen, int iterations, unsigned char* dk, size_t dklen ); // Example usage in kernel unsigned char password[56] = "123456-234567-345678-456789-567890-678901-789012-890123"; unsigned char salt[32]; // from hash params unsigned char derived_key[32]; // Derive 32-byte AES-256 key with 100,000 iterations pbkdf2_hmac_sha256_warp(password, 55, salt, 32, 100000, derived_key, 32); ``` -------------------------------- ### BitLocker Brute Force CUDA Kernel Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt The main CUDA kernel that iterates through candidate passwords, derives keys using PBKDF2, and attempts to decrypt the VMK using AES-CCM. It checks for a valid magic number to confirm a successful decryption and reports the found password. ```cpp #include "include/kernel.h" // Kernel signature __global__ void brute_force_kernel( unsigned char* salt, int salt_len, int iterations, unsigned char* nonce, int nonce_len, unsigned char* encrypted_data, int encrypted_len, unsigned long long start_index, unsigned long long candidates_per_launch, int* found_flag, unsigned char* result_password, unsigned long long* region_cycles, unsigned long long* region_counts ); // Kernel workflow per thread: // 1. Generate password from index: generate_password(idx, pwd) // 2. Derive key: pbkdf2_hmac_sha256_warp(pwd, passlen, salt, salt_len, iterations, key, 32) // 3. Decrypt VMK: aes_ccm_decrypt(encrypted, len, key, 32, nonce, nonce_len, 12, plaintext) // 4. Verify magic: plaintext[0:4] == "VMK\0" // 5. Claim result: atomicCAS(found_flag, 0, 1) and copy password // Launch configuration int blocks = 1024; int threads_per_block = 256; brute_force_kernel<<>>( d_salt, salt_len, 100000, d_nonce, nonce_len, d_encrypted, encrypted_len, start_index, candidates_per_launch, d_found_flag, d_result_password, d_region_cycles, d_region_counts ); ``` -------------------------------- ### AES-CCM Decryption (CUDA C++) Source: https://context7.com/caveman8080/bitlocker_rpc/llms.txt Provides a device-side implementation of AES-CCM authenticated decryption. This function is used to decrypt the encrypted VMK data and verify its integrity using the provided key, nonce, and authentication tag. ```cpp #include "crypto/aes_ccm.h" // Decrypt and verify authentication tag __device__ bool aes_ccm_decrypt( const unsigned char* encrypted, int encrypted_len, const unsigned char* key, int key_len, // 16 (AES-128) or 32 (AES-256) const unsigned char* nonce, int nonce_len, int tag_len, // Authentication tag length (typically 12) unsigned char* decrypted ); // Example usage unsigned char key[32]; // Derived from PBKDF2 unsigned char nonce[12]; // From hash params unsigned char encrypted[48]; // From hash params unsigned char plaintext[64]; bool valid = aes_ccm_decrypt(encrypted, 48, key, 32, nonce, 12, 12, plaintext); if (valid && plaintext[0] == 'V' && plaintext[1] == 'M' && plaintext[2] == 'K' && plaintext[3] == 0x00) { // Valid VMK found - password is correct! } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.