2022-05-15 16:45:47 +02:00
|
|
|
from rot import decrypt as dec
|
|
|
|
from rot import chars
|
2022-05-15 15:04:38 +02:00
|
|
|
from sys import argv
|
|
|
|
from collections import Counter
|
|
|
|
|
2022-05-15 16:45:47 +02:00
|
|
|
def brkc(m: str, f: str):
|
|
|
|
t=tuple(open(f).read().splitlines()[:1000])
|
2022-05-15 15:04:38 +02:00
|
|
|
decm=[]
|
|
|
|
for i in range(1, len(chars)):
|
|
|
|
decmsg=dec(m, i)
|
|
|
|
print(f"{i}: {decmsg}")
|
2022-05-15 17:17:55 +02:00
|
|
|
for x in t:
|
|
|
|
if x.upper() in decmsg:
|
|
|
|
decm.append(decmsg)
|
2022-05-15 15:04:38 +02:00
|
|
|
return Counter(decm)
|
2022-05-15 16:45:47 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
a=argv[1]
|
|
|
|
b=argv[2]
|
|
|
|
print(brkc(a, b))
|