Linux.com

Feature: Security

Four ways to hide information inside image and sound objects

By Anže Vidmar on May 21, 2007 (8:00:00 AM)

Share    Print    Comments   

Ever find yourself with too many passwords to remember and no idea where to keep them so that only you can find the password list? Creating a password.txt file in your root directory is out of the question, as is a password-protected OpenOffice.org file. A piece of paper hidden somewhere is not a good idea, because after you forget where did you put it, someone else will find it and abuse it. Instead of these approaches, consider using steganography, a method for hiding sensitive information inside some other object, typically a JPEG picture or a sound file.

With steganography, a plain text file is merged with a picture or sound file. The resulting file looks and sounds the same -- only the size of the file is slightly changed. For extra security, you can encrypt the text file before you merge it.

Here's a look at some useful tools that you can use to hide and unveil sensitive information inside an object. Most of these programs and tools are available in package repositories for different Linux distributions.

OutGuess

OutGuess is console-based universal steganographic tool that can hide information inside picture objects. The latest version, 0.2, was released in late 2001 and supports inserting objects into PPM, PNM, and JPEG image formats. OutGuess can be used on Linux, *BSD, Solaris, AIX, HP-UX, Mac OS X, and Windows.

Suppose I want to securely send a coworker a root password for a production server. I can start by putting the password in a pass.txt file, then encrypt it with a secret key ("summer" -- shh, don't tell anyone) and mix the encrypted version with an image called grill.jpg. OutGuess can do that with one command:

~$ outguess -k summer -d pass.txt grill.jpg summer-grill.jpg

You don't need to use the -k option to encrypt the sensitive data with a secret key. If you leave it off, however, anyone who knows there's a file buried in the image can extract the output file.

Now I have an image named summer-grill.jpg that holds my production server's root password, and I can mail it to my coworker. Anyone who sees the picture won't notice anything strange, since the data in the image object is not visible to the human eye.

When my coworker receives the picture, he needs to extract the information from the file. As long as he knows the secret key I used for the encryption, he can run the command:

~$ outguess -k summer -r summer-grill.jpg pass.txt

If you don't specify the -k option and provide the key, OutGuess will extract the pass.txt file, but it won't be readable.

Steghide

Steghide is another program you can use to hide sensitive data inside image and audio files. The latest version of Steghide, 0.5.1, has been available since October 2003, and supports hiding sensitive information inside BMP and JPEG image formats as well as in AU and WAV audio formats. The default encryption algorithm is Rijndael with a key size of 128 bits, which is basically AES (Advanced Encryption Standard), but you can choose from many other encryption algorithms as well. Steghide runs under both Linux and Windows.

Let's use the same scenario from our previous example. The equivalent Steghide command is:

~$ steghide embed -cf grill.jpg -sf summer-grill.jpg -ef pass.txt -p summer

To extract the pass.txt file from the summer-grill.jpg picture, use this Steghide command:

~$ steghide extract -sf summer-grill.jpg

You'll be asked for a password, and the utility will extract the pass.txt only if your password (secret key) is correct. Note that when extracting we didn't specify any output file. That's because Steghide automatically knows what the file name was that was inserted and extracts the file with the same name.

Stegtools

Stegtools is a pair of command-line tools for reading and writing hidden information. The latest version of stegtools, 0.4b, was released in the middle of 2005. The software supports 24bpp bitmap images, and runs on Linux and FreeBSD operating systems.

Using the same example again:

cat pass.txt | /usr/local/stegotools-0.4b/stegwrite grill.jpg summer-grill.jpg 1

Here I redirect the standard input (the output of cat command) into the stegwrite tool and specify an existing and desired output picture object. I used the full path to my stegwrite tools, since they're not in my $PATH. The number at the end of the command represents the number of last bits of the grill.jpg image that will be used to hide my data. The value may be 1, 2, or 4. More in-depth explanation can be found in the software's README file.

Stegread reads the hidden information from a picture object and writes it to the standard output. If I want to extract the password from summer-grill.jpg image, I can use this command:

~$ /usr/local/stegotools-0.4b/stegread summer-grill.jpg 1 > pass.txt

You need to have the right number of last bits in order to successfully extract the password from the object file. If you don't know the right number, the utility leaves you with an empty pass.txt file.

SteGUI
SteGUI - click to enlarge
SteGUI, a Steghide GUI

SteGUI is a Linux-based graphical front end to Steghide that was released in May 2006. Before you install SteGUI you need the stegtools, FLTK toolkit, PStreams, ALSA, and Libjpeg libraries installed.

The menus in SteGUI allow you to open objects (picture or sound) and extract or embed information by selecting and clicking on the screen. Here you can see that I've opened my grill.jpg picture and am preparing to embed the pass.txt file. You can also see how many cryptographic algorithms are available for the job. Although it's a nice interface, SteGUI is useful only with objects made with the Steghide program.

Conclusion

Steganography can be useful in many ways for sharing and hiding personal information. Among these utilities, someone who would like to use steganography on multiple platforms would choose OutGuess. For someone who doesn't like console-based tools, Steghide plus SteGUI is the best choice.

Share    Print    Comments   

Comments

on Four ways to hide information inside image and sound objects

Note: Comments are owned by the poster. We are not responsible for their content.

Shock and awe-ful.

Posted by: Anonymous Coward on May 22, 2007 08:32 AM
I recommend hiding your information in a goatse.cx image. If anyone can sit still long enough to decode that? Then they deserve it.

#

Illusion of security

Posted by: Anonymous Coward on May 21, 2007 10:42 PM
If you really want to send someone a root password for a server you should consider using gnupg.

For storing passwords safely and _comfortably_ try keepass.

If it's for anything else, use a combination of gnupg and one of the stenography tools above, never only rely on the latter one.

One last note to the author: What makes you think that someone wouldn't remember where he put a piece of paper but instead would remember in which of the thousands of pictures one someones computer he put a file? Honestly, I don't see the difference.

#

Re:Illusion of security

Posted by: Anonymous Coward on May 22, 2007 08:04 PM
I fully support: gnupg for exchanging, and keepass for comfortable, multi-platform, storage of personal passwords.

#

Interesting article, but paper still wins

Posted by: Anonymous Coward on May 22, 2007 12:49 AM
These all sound interesting and useful, but I'll still take paper over these in a heartbeat. I keep all of my passwords into a nondescript notebook (it doesn't say "sekrit passwords inside!! no looking!!), which is kept in a locked filing cabinet along with a messy bale of other files and documents. It's portable, doesn't need power to be readable, and never crashes.

Even if someone found the notebook they would have a hard time using the information, because I use my own shorthand and messy handwriting. I keep a second copy locked up at home.

I do not keep any passwords on my computer because digital storage is too fragile. Power failures, theft, snoopy people poking around my office, hardware failures, and you need the machine they're stored on- no thanks, I'll trust paper for now.

#

Re:Interesting article, but paper still wins

Posted by: Anonymous Coward on May 23, 2007 07:29 AM
All your passwords in a notebook?
Your own shorthand?
Messy handwriting?
You've done this all twice?
What?

You're joking right? You can not possibly be serious in thinking that encryption is less secure than um... your "method"!

#

Re:Interesting article, but paper still wins

Posted by: Anonymous Coward on May 30, 2007 03:47 AM
Security through obscurity

#

Why not just encrypt a text file?

Posted by: Anonymous Coward on May 22, 2007 03:47 AM
I just tripple-DES encrypt my password file. I use the widely available openssl to encrypt and decrypt. With a VIM plugin this is transparent. This VIM plugin it makes a nice, simple password safe:

        <a href="http://www.vim.org/scripts/script.php?script_id=1833" title="vim.org">http://www.vim.org/scripts/script.php?script_id=1<nobr>8<wbr></nobr> 33</a vim.org>

OpenSSL supports other ciphers if you don't trust triple DES.

#

Re:Why not just encrypt a text file?

Posted by: Anonymous Coward on May 22, 2007 04:48 AM
Emacs too supports transparent handling of encrypted files through GnuPG interfaces available as emacslisp extensions.

Among them, I find <a href="http://www.easypg.org/" title="easypg.org">EasyPG</a easypg.org> the most useful and easy to use.

Refer to <a href="http://www.emacswiki.org/" title="emacswiki.org">Emacs Wiki</a emacswiki.org> for more.

#

Encryption

Posted by: Anonymous Coward on May 22, 2007 09:49 PM
The problem with Stegano is that it's way too oldschool. We used that back in the days when encryption was a flaky subject. These days, an encrypted text file on an encrypted filesystem on a usb key is probably your best bet.

Of course, you need to make sure that you use passphrases, not passwords.

#

very cool

Posted by: Anonymous Coward on May 23, 2007 12:44 AM
regardless of its technical merits, the very idea of encrypting stuff into an image is cool.

now i want to know... how do they put mal-- er, interesting code into images<nobr> <wbr></nobr>:)

#

Like this? :D

Posted by: Anonymous Coward on May 23, 2007 06:33 AM
$ ping6 09F9:1102:9D74:E35B:D841:56C5:6356:88C0
socket: Address family not supported by protocol

#

Four ways to hide information

Posted by: Administrator on May 24, 2007 03:55 PM
I was just thinking but feel free to correct me if i am wrong,
But if its possible to hide this kind of info in images or music, What would be stopping Black hat people out there from hiding/embedding automatic mal-scripts into them.

#

Four ways to hide information inside image and sound objects

Posted by: Anonymous [ip: 88.241.137.203] on January 09, 2008 12:51 PM
Best regards.

<a href="http://www.feramon.com">feromon</a> -
<a href="http://www.zets.net">Directory</a> -
<a href="http://www.by1by.com">directory</a> -
<a href="http://www.shopseks.com/feromon.html">feromon</a> -
<a href="http://www.hepzinde.com/feromon.html">feromon</a> -
<a href="http://www.koz-metik.com/toplist-a11.html">Kozmetik</a> -
<a href="http://www.shopseks.com/toplist.html">Shopseks.com</a> -
<a href="http://www.hepzinde.com/toplist.html">Hepzinde.com</a> -
<a href="http://www.hepzinde.com/penis-buyutucu.html">penis büyütücü</a> -
<a href="http://www.hepzinde.com/penis-buyutucu/penis-buyutucu-1.html">penis büyütücü</a> -
<a href="http://www.hepzinde.com/virility-pills.html">virility pills</a> -
<a href="http://www.hepzinde.com/elektronik-sigara.html">elektronik sigara</a> -
<a href="http://www.shopseks.com/virility-pills.html">virility pills</a> -
<a href="http://www.shopseks.com/penis-buyutucu.html">penis büyütücü</a> -
<a href="http://www.koz-metik.com/buyutuculer-c29.html">penis büyütücüler</a> -
<a href="http://www.koz-metik.com/bayan-fantazi-ic-giyim-c36.html">bayan iç giyim</a> -
<a href="http://www.koz-metik.com/virility-pills-p14.html">virility pills</a> -
<a href="http://www.koz-metik.com/elektronik-sigara-c46.html">elektronik sigara</a>
<a href="http://www.koz-metik.com/feromon-c47.html">feromon</a> -
<a href="http://www.shopseks.com/bayan-fantazi-ic-giyim.html">bayan iç giyim</a> -
<a href="http://www.hepzinde.com/bayan-erotik-ic-giyim-1-2-3.html">bayan iç giyim</a>

#

Four ways to hide information inside image and sound objects

Posted by: Anonymous [ip: 87.236.233.9] on February 26, 2008 10:25 AM
i need code for hide text inside mp3 file using
1- LSB
2- phase code
please help

#

Four ways to hide information inside image and sound objects

Posted by: Anonymous [ip: 87.236.233.9] on February 26, 2008 10:29 AM
i need code for hide text inside mp3 file using
1- LSB
2- phase code
please help

#

Four ways to hide information inside image and sound objects

Posted by: Anonymous [ip: 124.125.201.80] on March 01, 2008 09:02 AM
I like this article and its very useful for me.
I see the "STEGHIDE" software and i am interested to see its code so
I want source code for hiding audio file inside an image file in C/C++.

#

This story has been archived. Comments can no longer be posted.


 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya