Skip to content

Instantly share code, notes, and snippets.

@cvasqxz
Created May 16, 2021 21:44
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 cvasqxz/0590abd64299d8151ead5fe6a545882f to your computer and use it in GitHub Desktop.
Save cvasqxz/0590abd64299d8151ead5fe6a545882f to your computer and use it in GitHub Desktop.
Hello World with SHA256 hash collision
from hashlib import sha256
t = b'hola'
h = b''
while not t in h: h = sha256(h).digest()
p = h.find(t)
print(h[p:p+len(t)].decode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment