Post
Topic
Board Development & Technical Discussion
Re: Verifying K Value in Sagemath
by
krashfire
on 29/02/2024, 13:29:48 UTC

# Compute the new signature point
        P = k * G   (k = your new k on test)

        # Check if the x-coordinate of the signature point matches r
        if P.x() == r:
            print(f"Found k candidate: {k:x} ")
            private_key = (s * k - z) * mod_inv(r, n) % n
            print("Private Key      : %02x " % private_key)

Thank You!!