Skip to content

Instantly share code, notes, and snippets.

@yarjor
Last active April 2, 2018 07:09
Show Gist options
  • Select an option

  • Save yarjor/d486371b0561a5aae9368641a0d7cf7c to your computer and use it in GitHub Desktop.

Select an option

Save yarjor/d486371b0561a5aae9368641a0d7cf7c to your computer and use it in GitHub Desktop.
[XOR Strings] #crypto #xor
def repeating_key_xor(st,key):
return xor_strings(st, itertools.cycle(key))
def xor_strings(a, b):
return ''.join([chr(ord(i) ^ ord(j)) for i, j in zip(a, b)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment