Made version working with wordlist.

Fixed cesar.py to rot.py in breakrot.py.
This commit is contained in:
Mikołaj Lubiak 2022-05-15 16:45:47 +02:00
parent 646c07a443
commit a95ffb64bf
2 changed files with 9904 additions and 8 deletions

View File

@ -1,18 +1,20 @@
from cesar import decrypt as dec
from cesar import chars
from rot import decrypt as dec
from rot import chars
from sys import argv
from collections import Counter
def brkc(m: str, t: tuple):
def brkc(m: str, f: str):
t=tuple(open(f).read().splitlines()[:1000])
decm=[]
for i in range(1, len(chars)):
decmsg=dec(m, i)
print(f"{i}: {decmsg}")
for x in range(len(decmsg)):
for y in range(len(decmsg)):
if decmsg[x:y] in t:
for y in range(x, len(decmsg)):
if decmsg[x:y].lower() in t:
decm.append(decmsg)
return Counter(decm)
a=argv[1]
b=argv[2].split(" ")
print(brkc(a, b))
if __name__ == "__main__":
a=argv[1]
b=argv[2]
print(brkc(a, b))

9894
wordlist.txt Normal file

File diff suppressed because it is too large Load Diff