This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Encrypting images in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Encrypting images in java" Watch "Encrypting images in java" New topic
Author

Encrypting images in java

cle tan
Ranch Hand

Joined: Jun 11, 2012
Posts: 68
Need advice on this as I am still unable to encrypt /decrypt a images successfully in java. For the user to decrypt the image, the user has to click the image and enter the image password, similar to a password protected text file or pdf file.

Below is the function for encryption Image in java

cle tan
Ranch Hand

Joined: Jun 11, 2012
Posts: 68
I understand to decrypt the encrypted image, I need the user to run the decrypting application

wonder if there is any java libraries for software that encrypts image file such as Axcrypt? Otherwise when they get the encrypted image, they will have to download and run the java application to decrypt the encrypted image file, which is quite troublesome


some examples that have java libraries are itextpdf, which running will encrypt a PDF file
I would like to look for something similar to image files

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42370
    
  64
Why do you involve ImageIO and BufferedImage objects at all? It's all just binary data - just use a FileInputStream instead. And, of course, you shouldn't store it as ".jpg", because it no longer is an image.

Or are you saying that you want to be able to double-click the encrypted image in a file manager, and then be able to enter the password and then it will display the image? That's a lot more involved, and will require embedding the encrypted image in a native wrapper that does all that.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Encrypting images in java