I have this for encoding data in jpeg images in java. I am converting the text to its binary form and insert it to the LSB (depending on what the user has chosen.1,2,3,4) of the RGB in each pixel from (0,0) till (width,height).
outer:
for(int i = 0; i < height; i++){
for(int j = 0; j < width; j++){
Color c = new Color(image.getRGB(j, i));
int red = binaryToInteger(insertMessage(integerToBinary((int)(c.getRed())),numLSB));
int green = binaryToInteger(insertMessage(integerToBinary((int)(c.getGreen())),numLSB));
int blue = binaryToInteger(insertMessage(integerToBinary((int)(c.getBlue())),numLSB));
Color newColor = new Color(red,green,blue);
image.setRGB(j,i,newColor.getRGB());
}
}
gui.appendStatus("Binarized message is: " + binarizedMessage);
File output = new File(gui.getOutput()+".jpg");
ImageIO.write(image, "png", output);
Currently, im writing it as a png and it works well but I am hoping to make this in jpeg. I am successful getting those data in png. But as expected, failing in jpeg.
I am able to decode the hidden bits in the image written and see the message given that the correct LSB was chosen.
I am currently reading about about JPEG steganography but not getting it quite exactly how should I start it. I've seen algorithms, didnt helped me either.
I saw a code that doesnt have any main classes found.
Do I have to call it in my application? Modify it? How would I decode?
Here's a link to a code I have seen.
Aucun commentaire:
Enregistrer un commentaire