Created
September 11, 2022 18:50
-
-
Save sixTheDave/f1864a9d3a3eca9d7aa6edca8eed226c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from forge import * | |
hsh = '0xe50051a0af89748fe098cef3b163b6dc586a664e726791bb2a582ad364f42683' | |
sig = '0x2bdbc1826efc039719a28a9f4dbab9f4a2692d83de478300261a0e49019b63ee67c202ecc4ebdf82693da47824ac4fcf21f793400d85696034c4de9537c6ce491b' | |
pub = recover_public_key(hsh, sig) | |
addr = pub.to_checksum_address() | |
print('recovered (checksum) address:', addr) | |
a, b = 0, 1 | |
fhsh, fsig = forge(pub, a, b) | |
print('forged message hash:', fhsh) | |
print('forged signature:', fsig) | |
fpub = recover_public_key(fhsh, fsig) | |
faddr = fpub.to_checksum_address() | |
print('recovered address check:', 'correct' if faddr == addr else 'wrong!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment