TOP2
TOP2
#include <string>
#include <openssl/evp.h>
#include <openssl/ec.h>
#include <openssl/obj_mac.h>
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <openssl/bn.h>
#include <iomanip>
#include <sstream>
#include <vector>
#include <chrono>
#include <fstream>
#include <thread>
EVP_MD_CTX_free(mdctx);
stringstream ss;
for (unsigned int i = 0; i < length; i++) {
ss << hex << setw(2) << setfill('0') << (int)hash[i];
}
return ss.str();
}
EVP_MD_CTX_free(mdctx);
stringstream ss;
for (unsigned int i = 0; i < hash_len; i++) {
ss << hex << setw(2) << setfill('0') << (int)hash[i];
}
return ss.str();
}
if (public_key_len < 0) {
cerr << "Error converting public key to octet form" << endl;
return "";
}
stringstream ss;
for (int i = 0; i < public_key_len; i++) {
ss << hex << setw(2) << setfill('0') << (int)public_key[i];
}
BN_free(private_key_bn);
EC_GROUP_free(group);
EC_POINT_free(public_key_point);
return ss.str();
}
BN_copy(bn, div);
BN_free(div);
BN_free(rem);
BN_free(divisor); // Oslobađanje memorije za divisor
}
BN_free(bn);
BN_CTX_free(ctx); // Oslobađanje BN_CTX objekta
return result;
}
address += checksum;
if (!found_file) {
cerr << "Error opening found.txt" << endl;
return;
}
if (address.rfind(target_prefix, 0) == 0) {
auto end_time = chrono::steady_clock::now();
chrono::duration<double> elapsed = end_time - start_time;
cout << "\nFound address: " << address << endl;
cout << "Private Key: " << private_key << endl;
cout << "Public Key: " << pubkey << endl; // Ispis javnog ključa
cout << "Search time: " << elapsed.count() << " seconds\n";
if (i % 10000 == 0) {
auto end_time = chrono::steady_clock::now();
chrono::duration<double> elapsed = end_time - start_time;
double speed = (i / elapsed.count());
cout << "Thread progress: Checked " << i << " keys | Speed: " << speed
<< " keys/sec | Time elapsed: " << elapsed.count() << " seconds\n";
}
}
found_file.close();
}
vector<thread> threads;
int main() {
string start_private_key =
"00000000000000000000000000000000000000000000007545bf10859946eca";
string target_prefix = "1B"; // Prefiks koji tražimo
int num_threads = 12; // Broj niti koje želimo da koristimo
return 0;
}