least significant bit ?

Discussion in 'Ruby' started by q666, Mar 1, 2007.

  1. q666

    q666 Guest

    Hi
    I have a question about Steganography in ruby how could i write and read
    some data (bits) from a picture (for example a bmp file) hmm heh i think
    i known something about how the LSB works //i read the wikipedia ;) but
    i have problem whit the source i dont know how to write it. ? :(

    q666

    --
    Posted via http://www.ruby-forum.com/.
     
    q666, Mar 1, 2007
    #1
    1. Advertising

  2. q666

    Jan Svitok Guest

    On 3/1/07, q666 <> wrote:
    > Hi
    > I have a question about Steganography in ruby how could i write and read
    > some data (bits) from a picture (for example a bmp file) hmm heh i think
    > i known something about how the LSB works //i read the wikipedia ;) but
    > i have problem whit the source i dont know how to write it. ? :(


    if you can read and write bytes of the picture you can set any bit by

    byte |= 1 << bit_position (zero based)

    011110010 | (1 << 2) == 011110010 | 100 = 011110*1*10

    clearing a bit:

    byte &= ~(1 << bit_position)

    (at least this is the general idea, I might be a bit wrong ;-)
     
    Jan Svitok, Mar 1, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,855
    Timothy Bendfelt
    Jan 19, 2007
  2. onsbomma
    Replies:
    63
    Views:
    2,437
    Randy Howard
    Mar 21, 2005
  3. AAaron123
    Replies:
    0
    Views:
    648
    AAaron123
    Oct 3, 2008
  4. a01lida
    Replies:
    2
    Views:
    739
    a01lida
    Nov 16, 2008
  5. SMH
    Replies:
    0
    Views:
    249
Loading...

Share This Page