What is Nostr?
tragic
npub1u07…ez97
2025-01-05 17:48:30
in reply to nevent1q…ygxa

tragic on Nostr: Sure. Schnorr signatures take a nonce `k` and a challenge `e` and produce a signature ...

Sure. Schnorr signatures take a nonce `k` and a challenge `e` and produce a signature by computing:
s = k + e*a
, where a is the private key of the signer and the number we want to find.

The problem gave 2 signatures, which give a ssytem of linear congruences:
s_1 = k_1 + e_1*a (mod p)
s_2 = k_2 + e_2*a (mod p)

Since we know that the difference between k_2 and k_1 is 7, the system is suddenly determined and we can subtract equation 2 from equation 1:

s_2 - s_1 = k_2 - k_1 + e_2*a - e_1*a (mod p)

Now we know k_2-k_1 so:

s_2 - s_1 = k_delta + e_2*a - e_1*a (mod p)

And solve for a:
a = (s_2-s_1 - k_delta) * (e_2-e_1)^-1 (mod p)

Where ^-1 is the modular inverse.

waxwing (nprofile…rdgc) anotther fun challenge could be cracking the private key when the k are given by a predictable random number generator!
Author Public Key
npub1u07xw079lxwv24xslarh2eu4v37jtjmwvev0jyk3zjhxg2wnt56seyez97