+/Cryptopals
git clone https://git.julia.blue/+/Cryptopals
6d42c13
master
1import binascii 2 3b2hex = lambda b :binascii .hexlify (b ) 4 5fixedXor = lambda a ,b :bytes ([a [i ]^ b [i ]for i in range (len (a ))]) 6 7 8def repeatingXor (s ,k ): 9while len (k )< len (s ): 10k += k 11return b2hex (fixedXor (s ,k )) 12 13 14data = b"Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal" 15key = b"ICE" 16 17repeatingXor (data ,key ))