Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- alfabeto = "abcdefghijklmnñopqrstuvwxyz"
- secreto = input("Ingrese el mensaje secreto sin espacios: ")
- secreto = secreto.strip()
- for a in range(1,27):
- for b in range(1,27):
- mensaje = ""
- for letra in secreto.casefold():
- i = alfabeto.find(letra)
- try:
- indice = int(pow(a,-1,mod=27)*(i-b))% 27
- except:
- pass
- mensaje += alfabeto[indice]
- print("a:",a,"b:",b)
- print(mensaje)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement