wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: 41087
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
wood burning stoves
subject: Encrypting images in java
Similar Threads
PBEWithMD5AndDES Algorithm Exception
program that uses Bouncycastle throws an exception of illegal key size
Sorry about spamming the board with questions! But here another question about PBE encryption
Encryption/Decryption using java or oracle