ENCRYPTION With Python! #python #coding #programming

preview_player
Показать описание
This is an example of how to use Caesar's Cipher to encrypt a message in Python!
Рекомендации по теме
Комментарии
Автор

it's an implementation of Ceasars cypher.

aimanamin
Автор

you can simplify the handling of wraparound on lines 17 and 19 by using "output index = (input index +/- key) % len(ledger)" and eliminate the second if/else block.

nigh_anxiety
Автор

you could have shortened this by using ord and chr to convert each letter to ascii then add the key amnt to that ascii and then back to a letter/ symbol/ number and then print the letter with no end all in one line

message = "Secret Message"
key = 5

for i in range(len(message)):
print(chr(ord(message[i])+key), end = "")


and do the same in revers for decrypting

tobyholder
Автор

Another way to do this is to use .replace() and replace the characters that way, that’s what I did when I made Python encryptions/decryptions.

SoCool
Автор

I was wondering when you'd fix that syntax error. 🖥 👩‍💻

mavrosyvannah
Автор

Thanks broo for teaching this to will try it and give you a feedback about how this what..!!✌✌

vaishalibeautycare
Автор

I made a text compression (saves 50% of text) just in 27 lines. It can also work as encryption

jonassvaricek
Автор

nobody talking about how he spelt wraparound wrong

ropi
Автор

You cold wrap it in function at least.

davidsimek
Автор

Couldn't you just use % for the wraparound?

apollo_predates_soup
Автор

Encryption without using a library, cool!

martevius
Автор

I dream to have a keyboard that sounds like that 🫡

oceanau
Автор

Can't you just use Else statements? What's the point of using elif's here...

zerpointnothing
Автор

That's not encryption, it's a Caesarean Cipher....

izzyskywalkerr
Автор

wow those comments are absolutely awful

gigachad
Автор

"handle wraparaound" **cries in modular arithmetic**

also the string library exists, please just use string.ascii_lowercase and string.digits instead of typing them out

niuniujunwashere