Encryption program in Python 🔐

Publicado el: 17 noviembre 2022
en el canal de: Bro Code
121,549
3.4k

#python #course #tutorial

import random
import string

chars = " " + string.punctuation + string.digits + string.ascii_letters
chars = list(chars)
key = chars.copy()

random.shuffle(key)

#ENCRYPT
plain_text = input("Enter a message to encrypt: ")
cipher_text = ""

for letter in plain_text:
index = chars.index(letter)
cipher_text += key[index]

print(f"original message : {plain_text}")
print(f"encrypted message: {cipher_text}")

#DECRYPT
cipher_text = input("Enter a message to encrypt: ")
plain_text = ""

for letter in cipher_text:
index = key.index(letter)
plain_text += chars[index]

print(f"encrypted message: {cipher_text}")
print(f"original message : {plain_text}")


En esta página del sitio puede ver el video en línea Encryption program in Python 🔐 de Duración hora minuto segunda en buena calidad , que subió el usuario Bro Code 17 noviembre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 121,549 veces y le gustó 3.4 mil a los espectadores. Disfruta viendo!