Skip to content

Instantly share code, notes, and snippets.

@math77
Created September 1, 2018 19:34
Show Gist options
  • Save math77/ac5e7120c97e13287442595ca23e7e11 to your computer and use it in GitHub Desktop.
Save math77/ac5e7120c97e13287442595ca23e7e11 to your computer and use it in GitHub Desktop.
Exemplo de como é fácil descriptografar uma mensagem criptografada com a Cifra de César utilizando butre force
from string import ascii_lowercase as lower
def brutal_force(palavra):
cifras = []
for x in range(0, 26):
cifra = []
for letra in palavra:
cifra.append(lower[(lower.index(letra) - x) % tam])
cifras.append(''.join(cifra))
return cifras
print(brutal_force("pdwkhxv"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment