Encryption program in Python 🔐

preview_player
Показать описание
#python #course #tutorial

import random
import string

chars = list(chars)

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

for letter in plain_text:
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:
plain_text += chars[index]

print(f"encrypted message: {cipher_text}")
print(f"original message : {plain_text}")
Рекомендации по теме
Комментарии
Автор

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

BroCodez
Автор

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.

AM-mvro
Автор

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

zabehullahalizadeh
Автор

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

udivdyu
Автор

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

disdoodanimations
Автор

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

Pfp checks out

avivagmon
Автор

Thanks for all these helpful and very interesting videos ☺️

oumarelfarouqdiarra
Автор

These videos you've created are so helpful. thank you so much!!! NM✌

MacN_
Автор

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

moneyexploit
Автор

Radhe Radhe
Sanatan Hi Satya Hai
Jai To All Gods & Godesses
Jai Baba Farid Ji
Radhaswami Ji

aijazbirsfun
Автор

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

cashflow
Автор

I am too in college working on a final assignment, I will use this to encrypt user passwords for the project. thanks a lot! like and sub.

RODRIGO
Автор

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

Deformed
Автор

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

JarppaGuru
Автор

wow that was awesome knowing how this work.

recon
Автор

Can you please make a tutorial on how to make a “Key input” code? like when you enter the correct key in the input it sends a console log

EclipseRoblx
Автор

I made a substitution cipher....Then, I got carried away and now it is a multistaged cipher but the shift value is randomized and contained but in its own cipher in the output. So, one input can result in over 50 different outputs, yet they all decipher to that input.

Edit: I also made it random if the cipher itself is then ciphered again before being outputed.

ajflink
Автор

You can make it much shorter by changing it to string.printable which contains all of those characters.

Mosinsarmory
Автор

thamcuu lavuuuu of you i've got a place in our uni ❤

flclswm
Автор

Can you also teach us Ceaser encryption and other types of encryption methods?

OpGamer-kjve