cryptopals

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b04061a8d718ab0181f02ba9361ff37951baffdf
parent 93904ed7fea4e2cb1ab7a89b303847100d56b15e
Author: mpizzzle <michael.770211@gmail.com>
Date:   Sat,  7 Oct 2017 11:26:48 +0100

set 1 challenge 4 complete

Diffstat:
Mset1/detect_single_character_xor.py | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/set1/detect_single_character_xor.py b/set1/detect_single_character_xor.py @@ -0,0 +1,9 @@ +import sys + +with open('files/4.txt') as f: + hex_strings = f.read().splitlines() + +for hex in hex_strings: + for plaintext in [''.join([chr(x ^ ord(a)) for a in hex.decode("hex")]) for x in range(128)]: + if " the " in plaintext: + print plaintext+ \ No newline at end of file