How to Encrypt and Decrypt Files using Python

preview_player
Показать описание
Support me on Patreon to access all the source code for my tutorials and join a private community of Python Programmers:

In this tutorial we will explore how to encrypt and decrypt files using Python.

Encryption is a process of converting information into some form of a code to hide its true content. The only way to access the file information then is to decrypt it.

⭐️ Timeline
0:00 - Introduction
1:21 - Creating encryption key
3:29 - Loading encryption key
5:12 - Encrypting a file
8:18 - Decrypting a file
11:24 - Conclusion

📄 Resources

🔗 My Social Media

🎬 My YouTube Equipment

💸 Donations

--------------------------------------------------------------------------------------------------------------
⭐️ Tags
- Encrypt Python
- Encrypt files Python
Рекомендации по теме
Комментарии
Автор

WOW ! Thanks ! Best tutorial ever ! I modified the script for make a Input for choose the file (path) you want to crypt . Really nice, its work with all documents (even the .png) ! Thanks so much ! 😄😊😉🙂

imnoob
Автор

Great video, it's very insightful and I learned alot...
I'm going to build a password manager and I needed some form of basic encryption.

You helped me out today thank you ...

govinej
Автор

Nicely presented, just how I like it - organized, simple, straight-forward and, most importantly, no fluff, diversions, asides or unnecessary chatter. A really nice job. Thank you.

pdep
Автор

You Really Earned a subscriber bro, I have learned alot and surely gonna apply in projects

bhavikpunmiya
Автор

Best video ive seen, it's sad that all copypaste videos are getting recommended over this. GREAT STUFF!!

vapenhem
Автор

Code works 100% 👍
You're super amazing!

laythabdulkareem
Автор

Great sir, really very very impressive teaching way and knowlodge.

AdityaPandey-vutf
Автор

how can i encrypt files that are in a directory

crazex
Автор

After so many hours I found you and thankyou !!!

khalidhussain
Автор

How secure is this method, Im considering learning code again and thing I'd go back to making lil apps and found this subject to be interesting, do you think this would make a safe and secure enough encryption for an application?

Fullrusher
Автор

So the .key file type is considered as unlnown so read function doesnt work, anyone can help tell what needs to be done

quincychung
Автор

hi Misha. Thank you for the tutorial. Is there any way that I can just decrypt the file, and use those values in my code without having to create another file and write the decrypted data?

CRjosh
Автор

Hello and thank you for your video! I have managed to get my .py script, encrypted.

But now i'm stuck on the next step, how to make it possible to run the encrypted .py file on raspberry.

So for example i have script in .py, i want to share this script with other people, to enable them to run my script on their raspberry, but i want to keep the code within the script encrypted.
Do you have any pointers for me on how to do this?

Thanks in advance! And again thanks for the great video!

perrysatoshi
Автор

I have similar code to encrypt multiple files, but it is really way too slow if the files are about 50+ files and have videos in it, I dont know what to do to speed it up

crispol
Автор

Hello,
What do we do with the encryption key ? If for example I need to build a Production level app. How do I handle the encryption key ? Its bad practice to store it with the program. It is bad practice to hardcode the key into the code. What is the best approach ?

romangeneral
Автор

The only problem with encryption I tried it i encrypted a python script and tried running it it won't run it shows the encryption in cmd and invalid syntax

joymackey
Автор

Nice tutorial... thank you...
Can I decrypt any PHP files which is already Encrypted by this technique ?

subhendumondal
Автор

This was a symmetric key right? Assume using the asymmetric key pair works too?

Runawaygeekchannel
Автор

i have an issue "ModuleNotFoundError: No module named 'cryptography'" any chance you know how to solve this

YohanceToye
Автор

hi, pretty sure that this account isn't active anymore, but if someone see this message, what's the use of opening the file with "rb" for example and not "r" i understand that b is binary but why do i am supposed to use that ? ( I'm french excuse my horrible english level )

tomfiszelson