Created
February 10, 2017 06:18
-
-
Save SciresM/f22ce61eacc6c030cc19cd824b48c6ef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def fe_xor(string, key): | |
'''Decrypts a Fire Emblem Heroes string using a specified key.''' | |
if type(key) == str: | |
key = map(ord, key) | |
cur_k = (key[0] + key[1]) & 0xFF | |
crypt = '' | |
for i in range(len(string)): | |
cur_k ^= key[i % len(key)] | |
crypt += chr((cur_k ^ ord(string[i])) or ord(string[i])) | |
return crypt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment