File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Encrypting images in java" Watch "Encrypting images in java" New topic

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

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: Encrypting images in java
It's not a secret anymore!