Skip to content

Instantly share code, notes, and snippets.

@Tony3-sec
Last active November 15, 2015 01:55
Show Gist options
  • Save Tony3-sec/233c4eb952852e043423 to your computer and use it in GitHub Desktop.
Save Tony3-sec/233c4eb952852e043423 to your computer and use it in GitHub Desktop.
XOR encode the user input with arbitary key
#!/usr/bin/python
## Simple xor encoder
def simpleXOR():
result = ''
data = raw_input('Enter data: ')
key = raw_input('Enter key: ')
for i in data:
result += chr(ord(i) ^ int(key))
return result
simpleXOR()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment