Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading encrypted gif file.

807580Jul 21 2010 — edited Jul 22 2010
So I'm trying to view an ecrypted image (gif). I've done the encryption part and my problem lies on reading the encrypted image since the ImageIO.read(in) method returns a bufferedImage but returns a null if its encrypted so I can't display it.

image = ImageIO.read(file);
buffimage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB);
ImageIO.write(buffimage, "gif", baos);
baos.flush();
ciphertext = encrypt(baos.toByteArray()); //encrypt
baos.close();

secimage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB);

InputStream in = new ByteArrayInputStream(ciphertext);
secimage = ImageIO.read(in); // returns null :(

in.close();

Is there another way of doing this? please help


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2010
Added on Jul 21 2010
6 comments
450 views