Last active
August 24, 2022 15:11
-
-
Save 0xa13d/37bb327e904d14f0de757213dd331d8f to your computer and use it in GitHub Desktop.
Simple xor function for python
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
from itertools import cycle | |
def xor(key: bytes, data: bytes) -> bytes: | |
return bytes(a ^ b for a, b in zip(data, cycle(key))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment