Reading encrypted gif file.
807580Jul 21 2010 — edited Jul 22 2010So 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