Disabling Ciphers in Image Magick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
meenal.joshi
Posts: 5
Joined: 2014-05-29T03:32:51-07:00
Authentication code: 6789

Disabling Ciphers in Image Magick

Post by meenal.joshi »

Hi,

I want disable ciphers in ImageMagick for windows.
ImageMagick version: ImageMagick-6.9.1-Q16
I am using Windows 7 - 64 bit OS

How can I configure --disable-ciphers in ImageMagick (for windows)?
I am not able to find any configure program which will disables ciphering for ImageMagick.

Any suggestions on how I can resolve this issue?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Disabling Ciphers in Image Magick

Post by snibgo »

"--disable-cipher" is an option to "configure". If you compile IM yourself, just put the option in the configure command.

If you don't compile IM yourself, this option is not available.
snibgo's IM pages: im.snibgo.com
meenal.joshi
Posts: 5
Joined: 2014-05-29T03:32:51-07:00
Authentication code: 6789

Re: Disabling Ciphers in Image Magick

Post by meenal.joshi »

Ok. It means if I am installing ImageMagick (for image processing like conversion from one format to another) and NOT compile IM, I cannot disable ciphers? and ImageMagick will by default perform enciphering and deciphering while Image conversion?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Disabling Ciphers in Image Magick

Post by snibgo »

No. The "--disable-cipher" at compilation prevents the use of the command-line options "-encipher" and "-decipher".

By default, IM does not encipher or decipher images. It will only do so if you tell it to.
snibgo's IM pages: im.snibgo.com
meenal.joshi
Posts: 5
Joined: 2014-05-29T03:32:51-07:00
Authentication code: 6789

Re: Disabling Ciphers in Image Magick

Post by meenal.joshi »

ok. Thanks a lot for your help :)
SanjayJadhav
Posts: 11
Joined: 2015-05-22T06:43:00-07:00
Authentication code: 6789

Re: Disabling Ciphers in Image Magick

Post by SanjayJadhav »

Hi Guys,

Even I have to disable Cipher from my ImageMagick source code. I have following queries. It would be really great If you guys can provide me help.

1.Do you mean to say that I have to put this disable command in "C:\ImageMagick-6.9.1\magick\magick-config.h" file
and then build Configure solution situated at "C:\ImageMagick-6.9.1\VisualMagick\configure\configure.sln" and later run the generated configure.exe . If so what is the exact syntax and location to put this in "C:\ImageMagick-6.9.1\magick\magick-config.h"
Here my source code is at "C:\ImageMagick-6.9.1" location.

2. In order to remove the Encryption code from ImageMagick sourec code I have removed the internal code (except for return statements) of all of the functions in "C:\ImageMagick-6.9.1\magick\cipher.c" and "C:\ImageMagick-6.9.1\magick\signature.c" and then rebuild my VisualStaticMTD.sln solution. Will it ensure that this change has completely removed the encryption capabilities from my ImageMagick. Or do I have to perform Disable Cipher mentioned in above point 1.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Disabling Ciphers in Image Magick

Post by magick »

Encryption code is isolated to cipher.c. Signature.c supports a one-way hash which is not encryption code. Removing the code in cipher.c as you suggested is a fool-proof way to remove all traces of encryption inside ImageMagick. Undefining MAGICKCORE_CIPHER_SUPPORT in magick/magick-baseconfig.h ensures that the binary distribution of ImageMagick does not include encryption support.
SanjayJadhav
Posts: 11
Joined: 2015-05-22T06:43:00-07:00
Authentication code: 6789

Re: Disabling Ciphers in Image Magick

Post by SanjayJadhav »

Aftrer removing the code in cipher.c I am just again rebuilding the VisualStaticMTD.sln solution and running the imageMagick installer again. Does it ensure that my changes made in the cipher.c and signature.c are there in my generated exe of imageMagick. I am asking this question because I could make it out that cipher.c and signature.c are part of which DLL that are compressed and put inside generated exe of imageMagick by the installer.

Also can you please tell the exact complete string that needs to be put in the magick/magick-baseconfig.h . Is it UNDEFINE MAGICKCORE_CIPHER_SUPPORT?
SanjayJadhav
Posts: 11
Joined: 2015-05-22T06:43:00-07:00
Authentication code: 6789

Re: Disabling Ciphers in Image Magick

Post by SanjayJadhav »

Hey and thanks lot for your previous answer. It gave me a confidence of going on the right path for generating exe of imageMagick.
Post Reply