You can check my thread on project development, you will find ground breaking ultimate hack scripts. Look for point torsion script, maybe that's what you are looking for.
“Ground breaking” 😁
rarely laughed so hard, just ridiculous - you guys make my day
TO Back on topic....
I made a new script in C++ based on my last post ...
https://bitcointalksearch.org/topic/m.63020009
I'm too slow and lazy to make a CUDA GPU version.
Version is still a beta version for testing, there are a lot of things that can be fail or improve.
This is the first time I am dealing with this part of OpenSSL .
I'm still learning what can be done with this swiss army knife.
Install the OpenSSL development package:
sudo apt install libssl-dev
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// Function to convert a byte vector to a hexadecimal string
std::string bytesToHex(const std::vector& bytes) {
std::stringstream ss;
for (unsigned char byte : bytes) {
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte);
}
return ss.str();
}
// Function to calculate the RIPEMD160 hash of a byte vector
std::vectorcalculateRIPEMD160(const std::vector & data) {
std::vectorhash(RIPEMD160_DIGEST_LENGTH);
RIPEMD160(data.data(), data.size(), hash.data());
return hash;
}
int main() {
// Initialize the OpenSSL library
if (OpenSSL_add_all_algorithms() != 1) {
std::cerr << "OpenSSL initialization failed." << std::endl;
return 1;
}
// Set the target Hash160 value (replace with your target hash)
std::string target_hash160_hex = "fe7c45126731f7384640b0b0045fd40bac72e2a2";
int puzzle = 15; // The puzzle number (Bits)
// Clear the console
std::system("clear");
std::cout << "\r\033[01;33m[+] Bytea HASH160 Search by NoMachine" << "\n";
time_t currentTime = std::time(nullptr);
std::cout << "\r\033[01;33m[+] " << std::ctime(¤tTime) << "\r";
std::cout << "\r\033[01;33m[+] Puzzle: " << puzzle << "\033[0m" << std::endl;
std::cout.flush();
// Calculate the maximum bytes value based on the puzzle
BIGNUM* limit_int = BN_new();
BN_set_word(limit_int, 1);
BN_lshift(limit_int, limit_int, puzzle);
BN_sub_word(limit_int, 1);
int max_bytes = (BN_num_bits(limit_int) + 7) / 8;
// Create an EC_KEY object
EC_KEY* ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);
// Calculate the SHA-256 hash of the public key
unsigned char sha256_result[SHA256_DIGEST_LENGTH];
// Calculate the RIPEMD160 hash of the SHA-256 hash
std::vectorripemd160_result(RIPEMD160_DIGEST_LENGTH);
while (true) {
// Create a 32-byte private key with 32 zeros followed by random bytes
std::vectorprivate_key_bytes(32, 0);
// Generate random bytes for the remaining part of the private key
std::vectorrandom_bytes(max_bytes);
if (RAND_bytes(random_bytes.data(), random_bytes.size()) != 1) {
std::cerr << "Error generating random bytes." << std::endl;
BN_free(limit_int);
EC_KEY_free(ec_key);
return 1;
}
// Append the random bytes to the private key
std::copy(random_bytes.begin(), random_bytes.end(), private_key_bytes.begin() + 32 - max_bytes);
// Create a BIGNUM from the private key bytes
BIGNUM* bn_private_key = BN_bin2bn(private_key_bytes.data(), private_key_bytes.size(), NULL);
// Set the private key in the EC_KEY object
EC_KEY_set_private_key(ec_key, bn_private_key);
// Compute the public key from the private key
EC_POINT* public_key_point = EC_POINT_new(EC_KEY_get0_group(ec_key));
EC_POINT_mul(EC_KEY_get0_group(ec_key), public_key_point, bn_private_key, NULL, NULL, NULL);
// Convert the public key point to binary representation (compressed)
size_t public_key_length = EC_POINT_point2oct(EC_KEY_get0_group(ec_key), public_key_point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL);
std::vectorpublic_key_bytes(public_key_length);
EC_POINT_point2oct(EC_KEY_get0_group(ec_key), public_key_point, POINT_CONVERSION_COMPRESSED, public_key_bytes.data(), public_key_length, NULL);
SHA256(public_key_bytes.data(), public_key_bytes.size(), sha256_result);
ripemd160_result = calculateRIPEMD160(std::vector(sha256_result, sha256_result + SHA256_DIGEST_LENGTH));
// Convert the calculated RIPEMD160 hash to a hexadecimal string
std::string calculated_hash160_hex = bytesToHex(ripemd160_result);
// Display the generated public key hash (Hash160) and private key
std::string message = "\r\033[01;33m[+] Public Key Hash (Hash 160): " + calculated_hash160_hex;
std::cout << message << "\e[?25l";
std::cout.flush();
// Check if the generated public key hash matches the target
if (calculated_hash160_hex == target_hash160_hex) {
// Get the current time
std::time_t currentTime;
std::time(¤tTime);
std::tm tmStruct = *std::localtime(¤tTime);
// Format the current time into a human-readable string
std::stringstream timeStringStream;
timeStringStream << std::put_time(&tmStruct, "%Y-%m-%d %H:%M:%S");
std::string formattedTime = timeStringStream.str();
std::cout << "\n\033[32m[+] PUZZLE SOLVED: " << formattedTime << "\033[0m" << std::endl;
std::cout << "\r\033[32m[+] Target Public Key Hash (Hash160) found! Private Key: " << bytesToHex(private_key_bytes) << std::endl;
// Append the private key information to a file if it matches
std::ofstream file("KEYFOUNDKEYFOUND.txt", std::ios::app);
if (file.is_open()) {
file << "\nPUZZLE SOLVED " << formattedTime;
file << "\nPrivate Key (hex): " << bytesToHex(private_key_bytes);
file << "\n--------------------------------------------------------------------------------------------------------------------------------------------";
file.close();
}
break;
}
}
// Free the EC_KEY and BIGNUM objects
BN_free(limit_int);
EC_KEY_free(ec_key);
return 0;
}
- Bytea HASH160 Search by NoMachine
- Sat Oct 21 10:39:23 2023
- Puzzle: 15
- Public Key Hash (Hash 160): fe7c45126731f7384640b0b0045fd40bac72e2a2
- PUZZLE SOLVED: 2023-10-21 10:39:24
- Target Public Key Hash (Hash160) found! Private Key: 00000000000000000000000000000000000000000000000000000000000068f3
It will solve Puzzle 15 for second on HASH 160 as target,
Compile
g++ -o puzzle puzzle.cpp -lssl -lcrypto -m64 -mssse3 -O3
./puzzle
p.s.
The Kangaroo Twins algorithm can be incorporated into the same based script for target_public_key_hex .