albertobsd / keyhunt

privkey hunt for crypto currencies that use secp256k1 elliptic curve
MIT License
640 stars 349 forks source link

BSGS Server (Only linux) #226

Closed domineaf closed 1 year ago

domineaf commented 1 year ago

Greetings albertobsd, I see that you updated today, if it is not too much trouble I would like to know what this modification refers to, thank you.

albertobsd commented 1 year ago

Welll you always can see the difference between commits:

https://github.com/albertobsd/keyhunt/commit/2edbebf862fc66f1abb2609d6bbb68976834ee12

Maybe you will notice some new files :)

https://github.com/albertobsd/keyhunt/blob/main/BSGSD.md

Check it

domineaf commented 1 year ago

Ok, let me check, Thanks!

sssergy commented 1 year ago

This works pretty slow. Is it possible to read public keys from a file, and set the range when starting the application?

albertobsd commented 1 year ago

This works pretty slow. Is it possible to read public keys from a file, and set the range when starting the application?

What? is the same speed of keyhunt bsgs.

About read the public keys from file then USE keyhunt instead..

if you want to use the server in that way you need to write your own client in your prefered language...

sssergy commented 1 year ago

I meant delays between the client and the server. There is another problem, with a large number of requests, RAM consumption increases. At the start, 180GB out of 250 is occupied, after half an hour the system kills the application due to lack of RAM.

image

Was tested on debian 11, ubuntu server 20.04 and kali linux.

albertobsd commented 1 year ago

I meant delays between the client and the server. There is another problem, with a large number of requests, RAM consumption increases. At the start, 180GB out of 250 is occupied, after half an hour the system kills the application due to lack of RAM.

OK the delays between client and server shoulbe near 0 unless you are running some things manually.

What language is your client? The time between then end of a conection and the new one should be near to zero

About the RAM consumption increase let me check that is something that i can test, thank you to point me to that.

Regards!.

sssergy commented 1 year ago

I meant delays between the client and the server. There is another problem, with a large number of requests, RAM consumption increases. At the start, 180GB out of 250 is occupied, after half an hour the system kills the application due to lack of RAM.

OK the delays between client and server shoulbe near 0 unless you are running some things manually.

What language is your client? The time between then end of a conection and the new one should be near to zero

About the RAM consumption increase let me check that is something that i can test, thank you to point me to that.

Regards!.

`import socket

def send_request(pub_key, range_start, range_end):

request_str = f"{pub_key} {range_start}:{range_end}"

# Connect to the server

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.connect(('10.10.0.28', 8181))

try:

    # Send the request

    s.sendall(request_str.encode())

    # Receive the response

    response = s.recv(1024)

    response_str = response.decode().strip()

    # Handle the response

    if response_str != "404 Not Found" and response_str != "400 Bad Request":

        # If the response is not an error message, it should be the private key

        print(f"The private key is: {response_str}")

        with open('found.txt', 'a') as f:

            f.write(f"Public key: {pub_key}, Private key: {response_str}\n")

finally:

    # Always close the connection

    s.close()

Read public keys from a file

with open('1test.txt', 'r') as f:

lines = f.readlines()

Extract public keys from lines and strip comments

public_keys = [line.split('#')[0].strip() for line in lines]

Send a request for each public key

for pub_key in public_keys:

send_request(pub_key, "1", "1FFFFFFFFFFFFFFFF")

`

The simplest version in python

sssergy commented 1 year ago

image image 26788 keys tested, increased RAM consumption from 182GB to 250GB. Time has passed 44 minutes.

albertobsd commented 1 year ago

Thanks for sharing the client is ok.

I already checked what are the issue about the ram consumption, i will commit the changes in some three hours.

albertobsd commented 1 year ago

The update is already available.

sssergy commented 1 year ago

The update is already available.

image These messages after each key are clearly not needed))

albertobsd commented 1 year ago

Ok I will remove those in the next update, mean while you can comment those printf lines.

By the way, what about the memory consumption? It was fixed?

sssergy commented 1 year ago

Ok I will remove those in the next update, mean while you can comment those printf lines.

By the way, what about the memory consumption? It was fixed?

Yes, no more memory leaks. The server is stable.

sssergy commented 1 year ago

Ok I will remove those in the next update, mean while you can comment those printf lines.

By the way, what about the memory consumption? It was fixed?

Hello! I'll ask again here) Together with the correction for a memory leak, you removed part of the commented out code. The server code was loading a list of keys from a file, could you return this function? I didn't save the old version.

By the way, I noticed that the Intel Xeon 8280 processor processes the keys faster, although the processor is "weaker" than the AMD EPIC 7763. Is this possible because of the compilation keys or is it just blue faster in ECC operations due to its architecture features?