Last active
August 18, 2020 22:20
-
-
Save mikeecb/a42781567c35c6564511a3550aaabe84 to your computer and use it in GitHub Desktop.
Cryptopals Challenge Set 1 Exercise 2
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(b1, b2): | |
b = bytearray(len(b1)) | |
for i in range(len(b1)): | |
b[i] = b1[i] ^ b2[i] | |
return b | |
b1 = bytearray.fromhex("1c0111001f010100061a024b53535009181c") | |
b2 = bytearray.fromhex("686974207468652062756c6c277320657965") | |
b = bytes(xor(b1, b2)) | |
# the kid don’t play | |
b.encode("hex") | |
# 746865206b696420646f6e277420706c6179 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment