Created
December 25, 2016 18:16
-
-
Save codeguru42/c51faaff3d0ef3ce607268aba5d91cd7 to your computer and use it in GitHub Desktop.
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 main(): | |
with open(sys.argv[1]) as file: | |
plaintexts = map(lambda line : cryptopals.break_xor(bytes.fromhex(line.strip())), file) | |
for plain in plaintexts: | |
print(plain) | |
best = min(plaintexts, key=cryptopals.distance_from_english) | |
print(best) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment