Data Encryption with Pycryptodome & AES

  Рет қаралды 19,403

Practical Python Solutions

Practical Python Solutions

3 жыл бұрын

💻 Don't forget to Subscribe!
/ pythonspracticalsoluti...
------
In this video, we will learn how to code in Python by using the Pycryptodome encryption libraries.
Pycryptodome is a fork, or an evolution of Pycrypto, an earlier encryption library for python. Pycrypto is no longer in development and had some reported security issues, but you can check out my previous video on it if you are still curious
Pycryptodome brings several security enhancements to the Pycrypto library and, in our example, we are going to use it with AES or Advanced Encryption Standard (AES) cipher to encrypt text.
AES, of course, is only one of the ciphers that work with Pycryptodome - the libraries also works with legacy ciphers such as Triple DES and Blowfish. You can also use RSA for public key or Asymmetric encryption. And I’ll be doing videos on that shortly.
AES, however, is a very fast and secure for symmetric encryption.
AES is a 128-bit block cipher with key lengths of 128, 192 or 256 bits, depending on how paranoid you are with your encryption.
We’ll learn what these terms actually mean before jumping in to the code.
This overview should be helpful in understanding block ciphers, even if you are not going to write Python code.

Пікірлер: 50
@mattstrummer4918
@mattstrummer4918 3 жыл бұрын
This video is excellent for someone, such as myself, trying to learn how to use pycryptodome
@koa1319
@koa1319 9 ай бұрын
Thank you a lot for this video, i really struggled to find any documentation or guide on PyCryptoDome, it's also very well explained, and you have a nice voice, thank you a lot!
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 5 ай бұрын
Thank you for your feedback. I am glad the video helped you!
@WorldDstroyer
@WorldDstroyer 3 жыл бұрын
This is a very convenient video, as I only recently began writing programs using the PyCryptodome library. Thank you.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
thanks for the feedback and let me know if there is any other encryption-related stuff you are interested in.
@WorldDstroyer
@WorldDstroyer 3 жыл бұрын
@@practicalpythonsolutions-b4478 I think it would absolutely be helpful if you also covered a public key crypto-system like RSA or DSA, specifically with PyCryptodome. Digital signatures are important. Again, thank you for the helpful explanations in your videos.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
WorldDstroyer should have one soon on PGP and RSA
@WorldDstroyer
@WorldDstroyer 3 жыл бұрын
@@practicalpythonsolutions-b4478 Awesome! I forgot about PGP but it's also a good alternative for signature verification.
@software-sage
@software-sage 3 жыл бұрын
Thanks for the video. Super helpful
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
Thanks David
@pascalsimo8968
@pascalsimo8968 3 жыл бұрын
Thank for the video. thank for the video. So helpfull 🙏🏾
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
Glad you found it helpful
@TasneemMuneeraProttyasha
@TasneemMuneeraProttyasha 2 жыл бұрын
Thanks
@jelle5454
@jelle5454 3 жыл бұрын
Nice video! Please do a tutorial on RSA with pycryptodome!
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
Yes! in the works Thanx
@kaderali6246
@kaderali6246 Жыл бұрын
hi, can you please shaw me haw to encrypte as AES 256 bits, thanks
@caelim3524
@caelim3524 3 жыл бұрын
Hey would this be a reasonable way to encrypt data sent using python sockets. I’m interested in making a more secure chat server using encryption and the only problem I see with this in that application is at the start of the program you would need to send the key and the IV which has a chance on interception comprising the whole system
@shaunmascarenhas211
@shaunmascarenhas211 3 жыл бұрын
You would have to send the key and IV encrypted with a asymmetric key algorithm (public key encryption examples are RSA). AES is a symmetric encryption standard. After the key and IV are sent to the receiver you can use AES to encypt your messages and start communication securely.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
That may be better with TLS so stay tuned
@sumalatha24
@sumalatha24 Жыл бұрын
Very helpful video. When Iam using online aes encryption tool it is giving different ciphertext. May be IV we used here is random and not specified in program. One doubt sir if we give IV constant we can get same answer as online encryption tools.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 5 ай бұрын
Hello. Thank you for your feedback. I will create a short video soon to clarify your concern.
@happinin
@happinin Жыл бұрын
how would we get it if mysecretpassword was a variable and we wanted to store it from input() ? you cant put the b in the b'' in front of a variable...
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 5 ай бұрын
Hi. Sorry for the late reply. I will create a short to answer all the concerns. Thanks for your feedback!
@mylearninghub5074
@mylearninghub5074 2 жыл бұрын
What will happen , if someone tries to decrypt the encrypted file with an incorrect key? I think this scenario if you could also cover like how to validate the key as we shouldn't store the key even in encrypted file! Could you pls share your thoughts on this.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 2 жыл бұрын
good question. I didn't include this there should be some error checking to verify the key and handle an incorrect one. thanks
@BitCloud047
@BitCloud047 3 жыл бұрын
could you do eciespy? I want to use ECC but pycryptodome only uses NIST standard ECC's which are garbage.
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
Sure. Elliptic Curve encryption would be cool too. What's wrong with the NIST standard for ECC? Fifteen curves not enough?
@xtechnopro8316
@xtechnopro8316 3 жыл бұрын
Thank you so much but could you make a video on GCM mode in AES please
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
will do. thanks
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
We can certainly try :-) thanks for the feedback and I'll put it on the list
@joe-joe3540
@joe-joe3540 2 жыл бұрын
Hi,I like your videos.I trying to make an encryption program in CBC,but it doesn't decrypt files, could you help me please
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 5 ай бұрын
Hi. Sorry for the late reply. I will create a short to answer your question.
@pragatisingh4711
@pragatisingh4711 Жыл бұрын
Can you provide the link of image that u use in the video
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 Жыл бұрын
github.com/pmahon2016/symmetric_encryption/tree/master
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 Жыл бұрын
You should be able to find all files in here
@jeffreytagoc6205
@jeffreytagoc6205 3 жыл бұрын
do you have sample of encrypting a data files ?
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
Hi Jeffrey - to encrypt a file, just open it with the ‘with open (file name, ‘rb’) statement and read to a variable. Then you can encrypt the variable . Because the encryption works at the byte level, it doesn’t matter what type of file it is. (ie pdf, excel, etc.). I give examples in my Pycrypto and Asymmetric encryption videos.hope this helps but if not let me know.
@jeffreytagoc6205
@jeffreytagoc6205 3 жыл бұрын
@@practicalpythonsolutions-b4478 thank you sir how about key = b'dddddddddddddddd' what if i have a text box how i insert the key for example key = textbox.text
@jeffreytagoc6205
@jeffreytagoc6205 3 жыл бұрын
@@practicalpythonsolutions-b4478 how can I insert the value of the textbox or a name in key = b'dddddddddddddddd' for example key = pw or key = textbox.text
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
@@jeffreytagoc6205 you can use a variable for the key or you can open the file containing the key and use the read() method to pull into a variable
@jeffreytagoc6205
@jeffreytagoc6205 3 жыл бұрын
@@practicalpythonsolutions-b4478 got it, thanks sir.
@elhamali9073
@elhamali9073 3 жыл бұрын
please i want to connect with you via email , may i?
@practicalpythonsolutions-b4478
@practicalpythonsolutions-b4478 3 жыл бұрын
sure. my email is pmahon1998@yahoo.com
Encrypt files and strings with AES and Pycrypto
10:42
Practical Python Solutions
Рет қаралды 26 М.
AES: How to Design Secure Encryption
15:37
Spanning Tree
Рет қаралды 152 М.
🤔Какой Орган самый длинный ? #shorts
00:42
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 25 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 57 МЛН
GPG/PGP Free Data Encryption with Python
27:36
Practical Python Solutions
Рет қаралды 25 М.
128 Bit or 256 Bit Encryption? - Computerphile
8:45
Computerphile
Рет қаралды 331 М.
How secure is 256 bit security?
5:06
3Blue1Brown
Рет қаралды 3,2 МЛН
AES Explained (Advanced Encryption Standard) - Computerphile
14:14
Computerphile
Рет қаралды 1,2 МЛН
How To Design A Completely Unbreakable Encryption System
5:51
Half as Interesting
Рет қаралды 486 М.
Your Encryption Isn't Quantum Safe
9:22
IBM Technology
Рет қаралды 22 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 5 МЛН
Зачем ЭТО электрику? #секрет #прибор #энерголикбез
0:56
Александр Мальков
Рет қаралды 353 М.