@BroCodez

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

@AM-mv6ro

I'm 67 and was a complete beginner at programming when I started learning about computing in December 2021. I started with your Python beginner course and I am now a senior Python developer with 3 juniors that I oversee. Thank you Bro Code for your hard work and dedication.

@avivagmon9315

Bro code on his way to be a complete chill dude that dedicates every video to a fundraiser.

Pfp checks out

@katipunero_ph9920

I stop playing with Python almost a year.. After watching this video I easily regain some of my old python skill than other video.. Thank you

@AmanuelBerhanuTsehay

Awesome video as usual. I also learned we can use the  random.seed() function to replicate the shuffles and even use for passwords 
import random
import string
chars = string.ascii_letters + string.digits + string.punctuation + " "
chars = list(chars)


while True:
    main_choice = input("insert E to Encrypt, D to Decrypt or Q to Quit: ").lower()
    if main_choice == "e":
        print("Encryption Mode:")
        plain_text = input("Enter plain text: ")
        random.seed(input("Enter password: "))
        key = chars.copy()
        random.shuffle(key)
        cipher_text = ""
        for char in plain_text:
            cipher_text += key[chars.index(char)]
        print(f"cipher text: {cipher_text}")
    elif main_choice == "d":
        print("Decryption Mode:")
        cipher_text = input("Enter cipher text: ")
        random.seed(input("Enter password: "))
        key = chars.copy()
        random.shuffle(key)
        plain_text = ""
        for char in cipher_text:
            plain_text += chars[key.index(char)]
        print(f"Plain text: {plain_text}")
    else:
        break
    print("--------------------------------------")

@disdoodanimations

great video, your explaining is really good, i cant wait for your next video!

@zabehullahalizadeh2310

Thank you Bro Code . You are really active and you are doing very well. Keep on going

@kasman7349

Very informative and help me a lot. Thanks Bro

@skylineshorts5075

Thanks for the tutorial bro, can u make some pygame tutorial?

@Koshak87

07:55 - top 10 anime betrayals.

@JarppaGuru

1:32
x = range(33, 127)  # 33-126
ascii = ""
for n in x:
    ascii += chr(n)

@zohaibwaris-q8x

THANKS BRO  💙 these are the highest  quality videos I found on you_tube related to programming.

@Deformed

Hey brother, can you PLEASE do a video on your IDE setup and configuration? Or is it just default PyCharm as-is? I don't really like VS Code

@romeo9015

One way to make this more secure is to replace each character with a random number of characters. Then input more random strings of characters in between it. Keep track of what all these random string are equal to and implement a way of storing it separately from the message (another file works fine for testing). This will mean every message will have a different key, just like in the video. The method I described SHOULD prevent most simple cracking algorithms from accessing your data. You could further encrypt your keys with a separate, private algorithm if you’d like more security. There are also ways to encrypt the actual syntax in your algorithm if you need even more security (I forgot what this is called). If you need security for business or just doing wanna risk using your own, just use existing methods. It’s just more reliable.

@BrianKamau-h4n

you are a cybersecurity expert never knew

@moneyexploit

Love You Bro Code 
I Learned Python Paid Courses But They Teach Me About Basic Things In Python. But I Want to Deeper Understand in Python. Then I See Your Video I Learns a Lot's of Things More Than My Paid Courses. Thank you So Much. Love Again <3

@TestSanity

@BroCodez kindly share some end to end testing course in python as well

@ElFaruqBenYusuf

Thanks for all these helpful and very interesting videos ☺️

@tamz_exe

i'm a little late to this video, but this was a fun project. instead of making a decryption method i made it so it saves both the plain and encrypted texts into a json file, like a password manager

@recon6660

wow that was awesome knowing how this work.