Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This script requires python 3.5 but could be easily changed for older python versions
- # If you are on windows then download openssl from here: https://wiki.openssl.org/index.php/Binaries
- import subprocess
- import sys
- import os
- def Rot13(a):
- o = ord(a)
- return chr(o+13 if o < 78 else o-13)
- successes = 0
- path = " ".join(sys.argv[1:])
- pathrot13 = "".join([Rot13(a) for a in path])
- checks = [path, pathrot13, path[::-1], pathrot13[::-1], path.lower(), pathrot13.lower(), path[::-1].lower(), pathrot13[::-1].lower()]
- aeses = ["aes-256-cbc","aes-128-cbc","aes-192-cbc","aes-256-ecb","aes-128-ecb","aes-192-ecb"]
- for check in checks:
- for aes in aeses:
- if subprocess.run(["openssl", aes, "-d", "-in", "BRIEFCAES", "-out", "BRIEFCAES-out", "-k", check], stderr=subprocess.PIPE).returncode == 0:
- print(check)
- print("WIN!")
- os.rename("BRIEFCAES-out", "solutions/BRIEFCAES-"+str(successes))
- successes = successes + 1
Advertisement
Add Comment
Please, Sign In to add comment