[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

least significant bit ?

q666

3/1/2007 1:42:00 AM

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-....

1 Answer

Jano Svitok

3/1/2007 8:30:00 AM

0

On 3/1/07, q666 <q666@wp.pl> 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 ;-)