Skip to content

Instantly share code, notes, and snippets.

@Hitechcomputergeek
Last active April 4, 2017 18:36
Show Gist options
  • Save Hitechcomputergeek/7b235698847c32b931c946ac171007a7 to your computer and use it in GitHub Desktop.
Save Hitechcomputergeek/7b235698847c32b931c946ac171007a7 to your computer and use it in GitHub Desktop.
Taken from https://patrick.vande-walle.eu/uploads/2010/01/openrg-decrypt.py.txt because the original was 404ing but it was still in Google's cache
#!/usr/bin/env python
# OpenRG (http://www.jungo.com/openrg/pr_openrg.html) password deobfuscator
#
# Credits
# ~~~~~~~
# thanks to Zibri (http://www.zibri.org/2009/11/obfuscation-will-never-work.html)
#
# Contact
# ~~~~~~~
# cygeus at gmail dot com
#
# Changelog
# ~~~~~~~~~
# version 0.1
# - initial release
import re
import sys
def deobfuscate(enc):
key = [86, -12, -17, 80, 52, 169, -17, 107, 85, 75, 3, 60, 154, 1, 120, 179, -3, 177, 61, 211, 155, 210, 203, 159, 6, 209, 209, 101, -24, 189, 45, 159, 177, -17, 141, 216, -12, -4, 187, 195, 184, 161, 11, 174, 61, 193, 46, 174, -29, 84, 7, -15, 10, 90, 208, 138, 120, 4, 6, 50, 134, 44, 172, -14]
index = [0]
def decode(m):
text = m.group(0)
# character reference
if text[:1] == "&":
value = int(text[1:-1], 16)
# character
else:
value = ord(text[:1])
zib = value - key[index[0]]
if zib < 0:
zib = zib + 255
index[0] = index[0] + 1
return chr(zib);
return re.sub("&\w+;|[^&]", decode, enc)
def usage():
print "Usage: decrypt.py <encrypted key>"
if __name__ == "__main__":
if len(sys.argv) != 2:
usage()
else:
print deobfuscate(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment