Steganography on Red Hat-type Distros

If anyone has any tips on how to do steganography on RCSL distros, I’d be grateful! The repositories are not exactly full of nice GUI programs that will let you embed a message in a JPEG or PNG file, as far as I can tell.

The best I’ve been able to come up with is this:

cat image_name.jpg -> newimage.jpg

…at which point, you press Enter, type your secret message, press Enter again and then Ctrl+D to quit.

So this image:

…is a rather nice picture of our back yard, suitably sized for a 1080p wallpaper (provided you right-click on it and do a Save Link As, rather than trying to do anything with the thumbnail image shown!)

But if you were to type:

tail <path>/lyrebirdsteg.jpg

…in a terminal (the path bit being wherever you saved the full-sized file to), you should see something like this:

Deep in that feeble attempt to display binary data in a textual fashion you should see, one line before the end, a very clear copyright message, to complement the one that is visible in the bottom right-hand corner of the image itself. This is the text message I appended to the end of the JPG file, and you wouldn’t know it was there, except by this use of the tail command.

It’s this hidden, secret nature of messages encoded within an image that has always fascinated me about steganography (the word itself is Greek for “secret writing”). Using boring old ‘cat’ to make it happen is not what I had in mind, however: there are lots of lovely GUI programs available for Windows users and even Ubuntu and Fedora users. But not us old fuddy-duddies using RCSL, it would seem.

So I leave you with this (secret) message (and another shot from the backyard):

If anyone has the answer to the question posed by that last photo, I should be very happy to hear it!

Print Friendly

4 thoughts on “Steganography on Red Hat-type Distros

  1. dizwell Post author

    It’s pretty much installed by default, too. I’ve done a lot of work with ImageMagick over the past five years, but I didn’t realise it could do this (it generally has the worst command line syntax of ever tool I’ve ever used. Ever. That’s pretty bad!)

    I had a bit of fun combining images following that article… sadly, I’ve never yet managed to extract the ‘hidden’ image, despite them telling you two different ways of doing it (I only ever get back a fuzzy, noisy grey square).

    Some more GUI magic here required, I think!

    Reply
  2. dizwell Post author

    I had more luck having once installed the ImageMagick perl bindings package (in the standard repositories. This code then works quite nicely:

    #!/usr/bin/perl
    use Image::Magick;
    # This is the image to be hidden
    $watermark=Image::Magick->new;
    $watermark->ReadImage('lucretia.jpg');
    ($width, $height)=$watermark->Get('width','height');
    
    # This is the image in which to hide the earlier one
    $image=Image::Magick->new;
    $image->ReadImage('chandler.jpg');
    $image->SteganoImage(image=>$watermark,offset=>42);
    $image->Write('chandler.png');
    $image->Write('win:');
    #
    # Extract image from image.
    #
    $size="$width" . "x" . "$height" . "+42";
    $stegano=Image::Magick->new(size=>$size);
    $stegano->ReadImage('stegano:chandler.png');
    $stegano->Write('stegano.jpg');
    $stegano->Write('win:');

    So, if I give you the picture of my wallaby chandler, you should be able to extract the picture of my cat with the command:

    display -size 600x450+42 stegano:chandler.png

    Nice! (Still not GUI though… grumble, grumble…)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>