Is image type show any difference in calculating the time to encrypt or decrypt or encrypt and decrypt the image?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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)
0 Kommentare
Antworten (2)
Walter Roberson
am 6 Mai 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 Kommentare
Walter Roberson
am 24 Okt. 2017
Bearbeitet: Image Analyst
am 24 Okt. 2017
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
am 24 Okt. 2017
Patience Walter - you may have to wait a year and a half again for the answer.
Image Analyst
am 7 Mai 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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Encryption / Cryptography finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!