Skip to content

Instantly share code, notes, and snippets.

@av-gantimurov
Created June 11, 2020 07:33
Show Gist options
  • Save av-gantimurov/4e35bb62ab2a93a4506c3c63627fa3b2 to your computer and use it in GitHub Desktop.
Save av-gantimurov/4e35bb62ab2a93a4506c3c63627fa3b2 to your computer and use it in GitHub Desktop.
python3 xor algorithm
#!/usr/bin/env python3
import itertools
def xor(data, key):
return bytearray(a ^ b for a, b in zip(data, itertools.cycle(key)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment