least significant bit ?

Q

q666

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
 
J

Jan Svitok

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 ;-)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top