diff options
Diffstat (limited to 'set1/challenge5.py')
| -rw-r--r-- | set1/challenge5.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/set1/challenge5.py b/set1/challenge5.py new file mode 100644 index 0000000..432136e --- /dev/null +++ b/set1/challenge5.py @@ -0,0 +1,11 @@ +from itertools import cycle + +s = '''Burning 'em, if you ain't quick and nimble +I go crazy when I hear a cymbal''' +key = 'ICE' +expected = '''0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272\ +a282b2f20430a652e2c652a3124333a653e2b2027630c692b20283165286326302e27282f''' + +out = ''.join(['{:02x}'.format((ord(c) ^ ord(k))) for c, k in zip(s, cycle(key))]) + +assert out == expected |
