()
| 37 | |
| 38 | |
| 39 | def encrypt(): |
| 40 | texto = input("Input the text to encrypt : ") |
| 41 | abecedario = string.printable + "áéíóúÁÉÍÚÓàèìòùÀÈÌÒÙäëïöüÄËÏÖÜñÑ´" |
| 42 | abecedario2 = [] |
| 43 | nummoves = randint(1, len(abecedario)) |
| 44 | indexs = [] |
| 45 | |
| 46 | texttoenc = [] |
| 47 | |
| 48 | for l in range(0, len(abecedario)): |
| 49 | abecedario2.append(abecedario[l]) |
| 50 | |
| 51 | for let in range(0, len(texto)): |
| 52 | texttoenc.append(texto[let]) |
| 53 | |
| 54 | for letter in texto: |
| 55 | indexs.append(abecedario2.index(letter)) |
| 56 | |
| 57 | for move in range(0, nummoves): |
| 58 | abecedario2 += abecedario2.pop(0) |
| 59 | |
| 60 | texto = [] |
| 61 | |
| 62 | for i in range(0, len(indexs)): |
| 63 | texto.append(abecedario2[indexs[i]]) |
| 64 | texto.append(".") |
| 65 | |
| 66 | fintext = "" |
| 67 | |
| 68 | for letter2 in range(0, len(texto), 2): |
| 69 | fintext += texto[letter2] |
| 70 | |
| 71 | fintext = str(nummoves) + "." + fintext |
| 72 | |
| 73 | print(r"\Encrypted text : " + fintext) |
| 74 | |
| 75 | |
| 76 | sel = input("What would you want to do?\n\n[1] Encrypt\n[2] Decrypt\n\n> ").lower() |
no test coverage detected