Skip to content

Instantly share code, notes, and snippets.

@HectorSaldes
Last active October 20, 2021 20:37
Show Gist options
  • Save HectorSaldes/a1b8ed89dea1457a2b9c6217486cd6c5 to your computer and use it in GitHub Desktop.
Save HectorSaldes/a1b8ed89dea1457a2b9c6217486cd6c5 to your computer and use it in GitHub Desktop.
[Criptografía] - Clase para el cifrado y desifrado
"""
? Saldaña Espinoza Hector
* Seguridad informática
! 7B
"""
from sys import stdout
from alphabet import LETTERS
class Cryptography:
# * Encargada de crifrar las palabras
def encrypt(self, message):
textEncrypt = ''
for letter in message:
textEncrypt += LETTERS[letter]
return (textEncrypt)
# * Encargada de descifrar las palabras
def decrypt(self, message):
textDecrypt = ''
for letter in message:
for key, value in LETTERS.items():
if(letter == value):
textDecrypt += key
continue
return (textDecrypt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment