The image into which the message is to be hidden is known as the Carrier Image and the message or the file to be hiden is known as the payload.Each bit of the payload is hidden in the Least Significant Bit of either Red, Green and Blue for each pixel.That means we can hide 3 bits of payload per pixel.
Example:
In this example we will hide the letter 'A' (in binary 01000001)
Assume the three carrier pixels in RGB
R: 0011100 0
G: 0110100 1
B: 0000111 1
R: 0011010 0
G: 1000100 1
B: 0010001 0
R: 0011110 0
G: 1000010 0
B: 0011111 0
Here, we change the least significant bits (01101000) to our payload (01000001).
After this, our carrier pixels will be changed to
R: 0011100 0
G: 0110100 1
B: 0000111 0
R: 0011010 0
G: 1000100 0
B: 0010001 0
R: 0011110 0
G: 1000010 1
B: 0011111 0
The difference between 00001111 and 00001110 in the value for blue intensity is likely to be undetectable by the human eye.
Class Description:
Hides a payload(any file), along with an optional message inside the carrier image. Also gives you the
options to compress or to encrypt or to encrypt & compress the file before hiding it in the carrier
image.
Usage:
char[] password = new char[] {'p','a','s','s','w','o','r','d'};// your password, possibly from JPasswordField Steganograph steg = new Steganograph(); steg.setCompression(true); // enable compression steg.setEncryption(true); // enable encryption // hide the file steg.hide(new File("C:\\path\\to\\carrier\\Pictures"), new File("C:\\path\\to\\secret\\File"), new File("C:\\path\\to\\output\\folder"),"secret message to be encoded", password); // extract the file steg.reveal(new File("C:\\path\\to\\steg\\Pictures"),new File("C:\\path\\to\\output\\folder"), password);Example Image
This is the carrier image, with no hidden stuff in it.
This is the stegnographed image with the source code of this class hidden in it, zipped and encrypted (password is 'password').
The complete source code can be downloaded here.
its saying
ReplyDelete"
java.security.InvalidKeyException: Illegal key size or default parameters
"
On a default JVM installation , AES is limited to 128-bit key size. This is a remnant of import/export laws on cryptographic software. To unlock the larger AES key sizes, you need to download and apply the "JCE Unlimited Strength Jurisdiction Policy Files". (see at the bottom of this page [http://www.oracle.com/technetwork/java/javase/downloads/index.html].
ReplyDeletecan i use your class in my program ?
ReplyDeletei need it for my fyp
Yeah sure u can use it. If u can, a link back to this article would be nice, though its not mandatory ;)
Deletethe source code u have given, is applicable to all file type jpg , giff to png ,bmp.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehow to run in java
ReplyDeletehow to run in java
ReplyDeletehello plz help
ReplyDeletecan u pls be more specific. Its a netbeans project. you can run it easily with netbeans.
DeleteHi, great post.
ReplyDeleteOne question, why is necessary use carrier and secretFile, with only use secretFile and add to this image the message is enough, ¿is it?
not found error 404
ReplyDeleteThis is a very nice post. But when ever I run it, it's asking me of main method. Pls help me out
ReplyDeleteHi
DeleteThis is a library project. Create a new project with main method, add a reference to this library and use it, as shown in the sample.
Happy Coding:)
This is a very nice post. But when ever I run it, it's asking me of main method. Pls help me out
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for this post, it is very nice for the beginers like us. But i have a little problem with your implementation. I don't understand why the final image seem to be heavy than the original one.
ReplyDeletehi, thanks for making this post. i seem to be stuck at the extracting part. it just wont extract. it keeps refering to this part:
ReplyDeletesteg.reveal(new File("C:\\path\\to\\steg\\Pictures"),new File("C:\\path\\to\\output\\folder"), password);
especially the password part, and
public void reveal{}
please help me.