Skip to content

Instantly share code, notes, and snippets.

@zgohr
Created September 27, 2012 18:30
Show Gist options
  • Save zgohr/3795583 to your computer and use it in GitHub Desktop.
Save zgohr/3795583 to your computer and use it in GitHub Desktop.
xor
def xor(string, key):
data = ''
for char in string:
for ch in key:
char = chr(ord(char) ^ ord(ch))
data += char
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment