Results 1 to 6 of 6

Thread: Steganography

  1. #1
    AedonetLIRA is offline Member
    Join Date
    Oct 2010
    Posts
    22
    Rep Power
    0

    Default Steganography

    I'm teaching myself a little bit of steganography, which requires a fairly large amount of bit conversion. The source code I have shows me some of how it works but I'm not entirely sure where and how it works. If you could help/point me in a direction that I can fully understand this I would be greatful

    ~Aedon




    ::The code snippet::

    Java Code:
    private byte[] bit_conversion(int i)
        {
            byte byte3 = (byte)((i & 0xFF000000) >>> 24); //0
            byte byte2 = (byte)((i & 0x00FF0000) >>> 16); //0
            byte byte1 = (byte)((i & 0x0000FF00) >>> 8 ); //0
            byte byte0 = (byte)((i & 0x000000FF)       );
            //{0,0,0,byte0} is equivalent, since all shifts >=8 will be 0
            return(new byte[]{byte3,byte2,byte1,byte0});
        }
    Last edited by AedonetLIRA; 01-11-2011 at 01:20 AM.

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    Are you familiar with bitwise operations (AND, IOR, XOR, NOT), and arithmetic shifting?

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Steganography is about hiding data in other data. Picture data is especially well suited for this purpose because of its structure: pictures are matrixes of pixels and a single pixel is a combination of the colours red, green and blue. (There are other colour systems but stick to RGB for now). Each of the R, G and B values are small integers, typically in the range [0,255]. The higher the value the more intense the perception of the colour. Human eyes are not very sensitive to small intensity fluctuations, e.g a red value of 255 can't be distinguished from 254 (a difference of 1 bit).

    This is the clue to data hiding: suppose we manipulate a picture as follows: (I'll ony use the red value): if the red value is odd subtract one from the value for each odd valued pixel.

    After this manipulation we'll have a picture with the lowest bit of the red colour value set to zero. We can use those bits: we can 'embed' other data in it by setting the low bits to our data; this only changes the lowest bit of the colour and the fun is: a human being can't see it. Of course a computer program can find the data easily if we know how the data has been added to the picture. Just playing with the lowest bits of the red colour component is too naive so more advanced steganography methods use more tricky ways to plug in their own bits in the data but the principle is always the same: use those bits that can't be seen by human beings.

    kind regads,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    AedonetLIRA is offline Member
    Join Date
    Oct 2010
    Posts
    22
    Rep Power
    0

    Default

    @JosAH: Thanks for your reply, I am aware of what Steganography is, I was more looking at What was going on with the source.
    @Zack: Thanks for your reply, I also know he is shifting but I am not following how or why it is done. A buddy of mine just used an array of bit values instead of the shift described above. I was just looking for insight on that.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by AedonetLIRA View Post
    @JosAH: Thanks for your reply, I am aware of what Steganography is, I was more looking at What was going on with the source.
    The code you showed us chops an int apart in an array of four bytes, i.e. if the int is 0xAARRGGBB, the byte array contains the values 0xAA, 0xRR, 0xGG and 0xBB.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    AedonetLIRA is offline Member
    Join Date
    Oct 2010
    Posts
    22
    Rep Power
    0

Similar Threads

  1. Replies: 22
    Last Post: 02-24-2011, 05:56 PM
  2. Steganography
    By munish in forum Advanced Java
    Replies: 1
    Last Post: 07-28-2009, 06:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •