Created
April 9, 2018 22:07
-
-
Save pawlos/c010078f689a9a90af0b7e0e15371d7b to your computer and use it in GitHub Desktop.
Testing a known char as a part of decrypt key
This file contains 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
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