Is image type show any difference in calculating the time to encrypt or decrypt or encrypt and decrypt the image?

3 views (last 30 days)
Is image type show any difference in calculating the time to encrypt or decrypt or encrypt and decrypt the image? I am calculating the time complexity to encrypt and decrypt lena image of 5 types (lena.tif,lena.jpg,lena.png, lena.bmp, lena.gif)

Answers (2)

Walter Roberson
Walter Roberson on 6 May 2016
The time to decrypt an array is independent of how the array was derived, unless the "encryption" depends in subtle ways on the content of the image and the "information content" of some of the versions is different (e.g., JPEG probably has less information than the others.)
If you read in a JPEG lossy image, encrypt it, and write it out again as JPEG lossy, then do not be surprised if you cannot decrypt it properly afterwards.
  7 Comments

Sign in to comment.


Image Analyst
Image Analyst on 7 May 2016
I think you probably meant to use the word encoding and decoding rather than encrypting and decrypting. Saving a file encoded as PNG is an entirely different thing than taking an image array and encrypting it. Encoding uses a well described protocol and does not need any password or passkey or anything like that. So if you encode according to the BMP format for example, anyone can decode it because it is not encrypted.
Yes there will be slight differences because they use different formats, and some take time to compress the data while others don't. However the ones that compress take less time to save to disk that may or may not save more time than the excess time spent compressing. You just have to try it and see for different sized images. Do it over a big size range, like ten to one or so.

Categories

Find more on Encryption / Cryptography in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!