Created
April 29, 2015 01:10
-
-
Save boxmein/c8db4f9c909fadd04a82 to your computer and use it in GitHub Desktop.
ERC Checker v1
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| ## python3 {{f}} | |
| # thepowdertoy.net Early Registration Code #2 Checker For MiningMarsh | |
| # Code format: "ABCDEFG-HI-JKLMN-OPQ" | |
| # where each letter can be [A-Z0-9]. | |
| import hashlib | |
| # This is the hashed key for Challenge #2 (http://tpt.io/.286266) | |
| # Hash = SHA512 ( ("lolhash:" + ERC).encode('UTF-8') ) | |
| # where ERC is literally in the format described above. | |
| ERC_HASH = "9bf464bb07fde0cbb730535230c730c52fdb29692236b1fcb0941ded34ae83551120700614847dc9444553d477227aecc796aaa387d7c7d95c9e02b0a97fd1fd" | |
| def test(data): | |
| # print("received data: ", data) | |
| hs = hashlib.sha512() | |
| hs.update("lolsalt:".encode("UTF-8")) | |
| hs.update(str(data).encode("UTF-8")) | |
| hx = hs.hexdigest() | |
| # print("hexdigest", hx) | |
| return hx == ERC_HASH | |
| if __name__ == '__main__': | |
| while True: | |
| try: | |
| print(test(input("ERC guess> "))) | |
| except KeyboardInterrupt: | |
| print ("Interrupted, exiting") | |
| exit(0) | |
| except: | |
| raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment