tubeshowcase●1,135,246 videos♡ My collection 0
← Learn to Code

Learn to Code08:41

Encryption program in Python 🔐

Bro Code ↗

From the creator

#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}")

Published 2022-11-17 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code