Crude steganography with the command line

Here's a neat trick to have: using cat as a steganography tool to hide a RAR archive inside a simple jpg image.
The following will work on any Unix, including Mac OS X (for Windows see at the end of the post):

Step 1

Create a file with the data you want. If possible save it as an encrypted file.

Step 2

Compress it using RAR. Copy the RAR archive into the same directory as the jpg image.

Step 3

Open a terminal and type:

cat image.jpg archive.rar > newimage.jpg

The result is another jpg image. If you open newimage.jpg it will display the image, however if you try to unrar newimage.jpg RAR will extract the contents of the RAR archive you just appended to the image.
It's not super secure and if you look inside the image with a hex editor you can see the RAR archive, but it's a fast and simple way to use steganography.

For Windows use the following:

Open the cmd.exe and type

copy /b image.jpg + archive.rar newimage.jpg