# -*-coding:Latin-1 -*
import os
import math
from random import randrange
import pickle
listecompt = list()
mon_fichier = open("cryptos.txt", "r")
contenu = mon_fichier.read()
listecompt.append(contenu)
mon_fichier.close()
listecompt = str(listecompt)
listecompt = " ".join(listecompt)
listetxt = list()
listekey = list()
number = 0
data = 0
numberre = 0
filtre = 0
for lettre in listecompt:
if lettre == "[":
filtre = filtre + 1
if lettre == "," or lettre == "]":
if filtre == 2:
number = str(number)
listetxt.append(number)
if filtre == 3 and number != 0:
number = str(number)
listekey.append(number)
number = 0
data = 0
numberre = 0
if lettre == "0" or lettre == "1" or lettre == "2" or lettre == "3" or lettre == "4" or lettre == "5" or lettre == "6" or lettre == "7" or lettre == "8" or lettre == "9":
if data == 1:
numberre = number * 10
number = lettre
number = int(number)
number = numberre + number
else:
data = 1
number = lettre
number = int(number)
txtfinich = list()
lenge = 0
while lenge < len(listetxt):
txtcompt = listetxt[lenge]
keycompt = listekey[lenge]
txtcompt = int(txtcompt)
keycompt = int(keycompt)
txttranse = txtcompt - keycompt
if txttranse == 0:
txttranse = " "
if txttranse == 1:
txttranse = "A"
if txttranse == 2:
txttranse = "B"
if txttranse == 3:
txttranse = "C"
if txttranse == 4:
txttranse = "D"
if txttranse == 5:
txttranse = "E"
if txttranse == 6:
txttranse = "F"
if txttranse == 7:
txttranse = "G"
if txttranse == 8:
txttranse = "H"
if txttranse == 9:
txttranse = "I"
if txttranse == 10:
txttranse = "J"
if txttranse == 11:
txttranse = "K"
if txttranse == 12:
txttranse = "L"
if txttranse == 13:
txttranse = "M"
if txttranse == 14:
txttranse = "N"
if txttranse == 15:
txttranse = "O"
if txttranse == 16:
txttranse = "P"
if txttranse == 17:
txttranse = "Q"
if txttranse == 18:
txttranse = "R"
if txttranse == 19:
txttranse = "S"
if txttranse == 20:
txttranse = "T"
if txttranse == 21:
txttranse = "U"
if txttranse == 22:
txttranse = "V"
if txttranse == 23:
txttranse = "W"
if txttranse == 24:
txttranse = "X"
if txttranse == 25:
txttranse = "Y"
if txttranse == 26:
txttranse = "Z"
if txttranse == 27:
txttranse = "."
if txttranse == 28:
txttranse = "?"
if txttranse == 29:
txttranse = "!"
if txttranse == 30:
txttranse = ","
if txttranse == 31:
txttranse = ";"
if txttranse == 32:
txttranse = "/"
if txttranse == 33:
txttranse = "("
if txttranse == 34:
txttranse = ")"
if txttranse == 35:
txttranse = "+"
if txttranse == 36:
txttranse = "-"
if txttranse == 37:
txttranse = "*"
if txttranse == 38:
txttranse = ":"
if txttranse == 39:
txttranse = "'"
txtfinich.append(txttranse)
lenge = lenge + 1
txtfinich = str(txtfinich)
texttrad = " ".join(txtfinich)
cryptos_fich = open("uncryptos.txt", "w")
cryptos_fich.write("Text UnCrypt : \n")
cryptos_fich.write(texttrad)
cryptos_fich.close()
print("\n\n")
print("Creeation du fichier fini.")
print("\n")
os.system("pause")
exit()