Skip to content

Instantly share code, notes, and snippets.

@GordonOus
Last active August 20, 2021 15:58
Show Gist options
  • Save GordonOus/c5ee2b27c964201e60d2b8e84a3f1c97 to your computer and use it in GitHub Desktop.
Save GordonOus/c5ee2b27c964201e60d2b8e84a3f1c97 to your computer and use it in GitHub Desktop.
import string
from binascii import unhexlify
encrypted = unhexlify(open('msg.enc','r').read())
plaintext = []
#brute force the encryption logic
for b in encrypted:
for ch in string.printable:
if ((123 * ord(ch) + 18) % 256 == b):
plaintext.append(ch)
break
print(''.join(plaintext))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment