Page 1 of 1

Encipher / Decipher

Posted: 2008-02-13T09:27:57-07:00
by jpiquemal
Hello
How can i recognize an encipehered image ?

Re: Encipher / Decipher

Posted: 2008-02-13T10:15:47-07:00
by magick
How can i recognize an encipehered image ?
Two ways: 1) visually it appears as random data; 2) mathematically measure the randomness of the pixels (if its near random pixels it is most likely enciphered).

Re: Encipher / Decipher

Posted: 2008-02-14T13:01:56-07:00
by fmw42
Interesting. So how would one tell the difference between an enciphered image and one create with +noise in IM?

Re: Encipher / Decipher

Posted: 2008-02-14T16:25:09-07:00
by magick
A noisy image is generally not as random as an enciphered image. The noise is generally added or subtracted relative to the current pixel value. However, in rare cases it could be difficult or impossible to differentiate an image created with random noise from one that is enciphered.

Re: Encipher / Decipher

Posted: 2008-02-14T23:30:52-07:00
by jpiquemal
would it be possible to set a parameter in the Image structure, telling that the image is enciphered ?

Re: Encipher / Decipher

Posted: 2008-02-15T08:46:20-07:00
by magick
Sure we can set a property but the property will not be saved to most of the image formats since arbitrary metadata is not supported by most image formats. The properties are cipher:type, cipher:mode, and cipher:nonce.

Re: Encipher / Decipher

Posted: 2008-02-19T23:10:56-07:00
by anthony
For other following this discussion, You can see examples of enciphered images in IM Examples http://imagemagick.org/Usage/transform/#encipher

This includes some images and the pass-phrase used, so you can try to download and decipher them yourself.

WARNING: this is not considered stable, and as such requires a compile time configuration option. It also may still change, though that is starting to become less likely.

Please try out your encryption ideas and either mail them to me, or to the forum, so that I can test them myself, and add them to IM examples for others.

Re: Encipher / Decipher

Posted: 2008-12-22T15:44:40-07:00
by rmabry
For other following this discussion, You can see examples of enciphered images in IM Examples http://imagemagick.org/Usage/transform/#encipher

This includes some images and the pass-phrase used, so you can try to download and decipher them yourself.

WARNING: this is not considered stable, and as such requires a compile time configuration option. It also may still change, though that is starting to become less likely.

Hey Anthony,

I'm told that -encipher/-decipher are now standard, so when you get a chance, you can remove the caveat from this page:

"The "-encipher" and "-decipher" operators was added to IM v6.3.8-6. However it is currently experimental and requires you to include a "--enable-cipher" option during the build configuration. "

Rick

Re: Encipher / Decipher

Posted: 2008-12-22T18:21:15-07:00
by anthony
magick wrote:Sure we can set a property but the property will not be saved to most of the image formats since arbitrary metadata is not supported by most image formats. The properties are cipher:type, cipher:mode, and cipher:nonce.
Actually you probably would not want an image marked as being enciphered in any case! That is just asking for trouble!!!

I mean you may want to bury your encrypted image in amongst may other encrypted messages or even dummy encrypted images, so as to provide plusable deny ability with regards to 'rubber hose' attacks. EG if torture or legal presures are put to bear you can give the password for the dummy images and say the others are just random 'chaff'. That is useless if the chaff, and encrypted messages are distinguishable from each other.

Re: Encipher / Decipher

Posted: 2008-12-22T19:27:16-07:00
by anthony
rmabry wrote:I'm told that -encipher/-decipher are now standard, so when you get a chance, you can remove the caveat from this page:

"The "-encipher" and "-decipher" operators was added to IM v6.3.8-6. However it is currently experimental and requires you to include a "--enable-cipher" option during the build configuration. "
checking...
Yeap it does appear that "--enable-cipher" is no longer needed.

Do you know what version of IM that changed?

Re: Encipher / Decipher

Posted: 2008-12-22T20:41:44-07:00
by rmabry
anthony wrote: Yeap it does appear that "--enable-cipher" is no longer needed.

Do you know what version of IM that changed?
Nope, better ask the boss.

By the way, it's amusing what happens when you use -decipher on an unenciphered image. Not unexpected, of course, since there is no -enciphered flag.

Well, the result is perhaps somewhat kinda just a little unexpected (to me):

convert rose: rose.png
convert logo: -decipher rose.png logojunk.png

But this is ImageMagick 6.4.5 2008-10-24 Q16 on Windows, so I don't know what to expect with 6.8.0.

Time to upgrade again...

Rick

Re: Encipher / Decipher

Posted: 2008-12-23T01:19:53-07:00
by anthony
Cristy reports that it will mow treat an image as a binary string including null characters.