Created
September 27, 2012 18:30
-
-
Save zgohr/3795583 to your computer and use it in GitHub Desktop.
xor
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 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