Created
December 22, 2014 07:23
-
-
Save AntonKueltz/287c774f28ecf2f816e8 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 detect_single_byte(): | |
f = open('Data/4.txt') | |
best_freq, ptxt = 0, '' | |
for ctxt in f.read().split('\n'): | |
raw = ctxt.decode('hex') | |
txt = single_byte_cipher(raw) | |
cur_freq = char_freq(txt) | |
if cur_freq > best_freq: | |
best_freq = cur_freq | |
ptxt = txt | |
f.close() | |
return ptxt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment