Skip to content

Instantly share code, notes, and snippets.

@codeguru42
Created December 25, 2016 18:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save codeguru42/c51faaff3d0ef3ce607268aba5d91cd7 to your computer and use it in GitHub Desktop.
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