Skip to content

Instantly share code, notes, and snippets.

@Rurik
Last active November 3, 2022 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Rurik/11223222 to your computer and use it in GitHub Desktop.
Save Rurik/11223222 to your computer and use it in GitHub Desktop.
Generic code to do a multi-byte XOR encoding
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