Post
Topic
Board Development & Technical Discussion
Re: I found a method to reverse public keys to private keys
by
cassondracoffee
on 11/02/2025, 09:46:14 UTC
There have already been examples, what other proof do you need?

Reviewing their code, just to clarify, the trick seems to be that the signed message includes the nonce concatenated as part of the string. Somehow, the OP extracts the nonce from here, which allows them to derive the private key. In short, their code generates vulnerable signatures. The nonce should never be included in the message of a signature because it is a catastrophic vulnerability.

Code:
    def generate_signatures(self, priv, num_signatures=10):
        sigs = []
        for _ in range(num_signatures):
            nonce = random.randrange(1, 2**BIT_RANGE)
            note = str(os.urandom(25)) + str(nonce)
            msg = bytes(note, 'utf-8')
            private_key, public_key = self.make_keypair(priv)
            r, s, z = self.sign_message(priv, msg, nonce)
            sigs.append((z, r, s))
        return sigs

Nice observation,
You are correct,
But my trick works with also 256 bit random nonce if we have enough signatures

hi,
pubxy = 0xf30e2aaeccd1d8014cfb0f32f7c7a17edd4eb852d11bb6c65db56a0eafe3ec41 0xdff242ffc97c9923b42b9e4d360db5efce6f507aa2f443bf4fe6ec8e155f97d8
this pub was zero balance,show me priv key
and u share z rs from pubxy