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

조회 수: 2 (최근 30일)
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)

답변 (2개)

Walter Roberson
Walter Roberson 2016년 5월 6일
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
Walter Roberson
Walter Roberson 2017년 10월 24일
편집: Image Analyst 2017년 10월 24일
Do I understand correctly that you have something like,
impng = imresize( imread('lena.png'), [128 128]);
imtif = imresize( imread('lena.tif'), [128 128]);
imjpg = imresize( imread('lena.jpg'), [128 128]));
imbmp = imresize( imread('lena.bmp'), [128 128]));
and that then after that if you pass the results through the two different encryption methods, that they take different amounts of time, that can repeatably vary up to a full minute in timings?
Have you tried executing them in a random order to determine whether you might be getting some kind of order effect (sometimes the first time running code can be much slower)?
Image Analyst
Image Analyst 2017년 10월 24일
Patience Walter - you may have to wait a year and a half again for the answer.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 5월 7일
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.

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by