Last active
October 20, 2021 20:37
-
-
Save HectorSaldes/a1b8ed89dea1457a2b9c6217486cd6c5 to your computer and use it in GitHub Desktop.
[Criptografía] - Clase para el cifrado y desifrado
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
? 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