Skip to content

Instantly share code, notes, and snippets.

@pawlos
Created April 9, 2018 22:07
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 pawlos/c010078f689a9a90af0b7e0e15371d7b to your computer and use it in GitHub Desktop.
Save pawlos/c010078f689a9a90af0b7e0e15371d7b to your computer and use it in GitHub Desktop.
Testing a known char as a part of decrypt key
import sys
import string
data = 'e7225ea6c31ec63e843f53e3da21e104c5611c80c82cea02e7225ea6c31dea13d12955b7c819e604cc165da0d927e115e83e5db1df27e117855b'.decode('hex')
data = bytearray(data)
chrset = string.ascii_lowercase+string.digits+string.ascii_uppercase+'!'+'\x00'+':'+' '+'_'+'@'
ofs = 0
i = 0xa4
r = ''
n = ~i
for k in range(0,len(data)-ofs,8):
r += chr((data[k+ofs] ^ i) & 255)
r += chr((data[k+ofs+1] ^ n) & 255)
r += ' '
if all(c in chrset for c in r):
print hex(i), r#, r.encode('hex')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment