Advertisement
teslariu

afin

Jul 14th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. alfabeto = "abcdefghijklmnñopqrstuvwxyz"
  5. secreto = input("Ingrese el mensaje secreto sin espacios: ")
  6. secreto = secreto.strip()
  7. for a in range(1,27):
  8.     for b in range(1,27):
  9.         mensaje = ""
  10.         for letra in secreto.casefold():
  11.             i = alfabeto.find(letra)
  12.             try:
  13.                 indice = int(pow(a,-1,mod=27)*(i-b))% 27            
  14.             except:
  15.                 pass
  16.             mensaje += alfabeto[indice]
  17.         print("a:",a,"b:",b)
  18.         print(mensaje)
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement