Beispiel #1
0
from tools.KeyCipherBreaker import KeyCipherBreaker
from base64 import b64decode

cypher = ""
with open('6.txt', 'r') as f:
    ts = f.readlines()
    for t in ts:
        cypher += b64decode(t.strip())

breaker = KeyCipherBreaker()
print breaker.breakKey(cypher)
Beispiel #2
0
from tools.KeyCipherBreaker import KeyCipherBreaker

with open('4.txt', 'r') as f:
    cypher = []
    ts = f.readlines()
    for t in ts:
        cypher.append( t.strip().decode('hex') )


attempts = []
breaker = KeyCipherBreaker()
for s in cypher:
    attempts.append( breaker.breakSingleByteKey(s) )
def score(p):
    return p[1]
print max(attempts, key=score)
Beispiel #3
0
import sys
from tools.KeyCipherBreaker import KeyCipherBreaker

text = sys.argv[1].decode('hex')

breaker = KeyCipherBreaker()
print breaker.breakSingleByteKey(text)