Skip to content

Instantly share code, notes, and snippets.

@drewstaylor
Last active May 7, 2020 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewstaylor/60ebc96aac9e2ed4b99213fb57d36a6d to your computer and use it in GitHub Desktop.
Save drewstaylor/60ebc96aac9e2ed4b99213fb57d36a6d to your computer and use it in GitHub Desktop.
Unlocking the Genesis Exhibit in Satoshi's Lost Faucet - Genesis Exhibit Stage
import hashlib
bytes_o = b'b4813ede1ea918df665d2f84e2dc10eeaeb0984a'
filename = './Times_03Jan2009.jpg'
keyfile = open(filename, mode='rb').read()
sha256_file_hash = hashlib.sha256(keyfile).hexdigest()
ripemd160 = hashlib.new('ripemd160')
ripemd160.update(bytearray.fromhex(sha256_file_hash))
ripemd160_hash = ripemd160.hexdigest().encode()
assert ripemd160_hash == bytes_o
print('Bytes target sucessfully reproduced!')
print('Hashing ' + filename + ' with RIPEMD-160(SHA-256(filename)) is equal to: ', bytes_o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment