Commit 954339e5 authored by E214194U's avatar E214194U
Browse files

maj

parent 6b2cfbce
......@@ -61,17 +61,18 @@ with open("texte_chiffre_substitution.txt", "r",encoding="UTF-8") as txt:
ret=lignes
new=chiffre(lignes,key)
for i in range(0,1000000):
key=crypt(string.ascii_uppercase)
#print(oldkey)
if key not in oldkey:
oldkey+=key
new=chiffre(lignes,key)
#print("new",logscore(new))
#print("ret",logscore(ret))
if logscore(ret)>logscore(new):
ls=logscore(new)
ret=new
#print("best ls",ls)
for i in range(0,3):
print(oldkey)
while key in oldkey:
key=crypt(string.ascii_uppercase)
oldkey.append(key)
new=chiffre(lignes,key)
#print("new",logscore(new))
#print("ret",logscore(ret))
if logscore(ret)>logscore(new):
ls=logscore(new)
ret=new
#print("best ls",ls)
print("ret",ret)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment