Last active
November 3, 2022 13:05
-
-
Save Rurik/11223222 to your computer and use it in GitHub Desktop.
Generic code to do a multi-byte XOR encoding
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
def multibyte_xor(data, key): # Python 2 | |
from itertools import izip, cycle | |
return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data, cycle(key))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment