Reputation: 11
I was recently learning about encryption in python and tried out fernet library. Encryption and decryption was successful but I have some questions about the Runtime. While encrypting py,txt files which are usually of low storage size(bytes), encryption was done really fast but encryption with a png file which has storage size of approx 4 mb took more time.
I know with size it will eventually have to take more time but this png file took exactly 18.3 minutes Which is weird. This is the code below
Import fernet
key = fernet.Fernet.generate_key()
with open('image.png','rb') as image :
image_file = image.read()
encrypted_image = fernet.Fernet(key).encrypt(image_file)
with open('image.png','wb') as image_file :
image_file.write(encrypted_image)
Note :I did this on my pydroid application phone
So my question is it usually like this with the fernet library.
Upvotes: 1
Views: 233