Explanation for LSB data hiding

1 Ansicht (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 23 Mär. 2017
Beantwortet: dbmn am 23 Mär. 2017
Please can someone explain what does the numbers 248, 252, 128, 64 denote, in
red = bitand(redc,248);
blue = bitand(bluec,252);
bitand(text,128) == 128
bitand(text,64) == 64
bitor(red,4)
bitor(red,2)
bitor(red,1)
The below is a few lines from LSB...
red = bitand(redc,248);
green = bitand(greenc,248);
blue = bitand(bluec,252);
if bitand(text,128) == 128
red = bitor(red,4);
end
if bitand(text,64) == 64
red = bitor(red,2);
end
if bitand(text,32) == 32
red = bitor(red,1);
end

Akzeptierte Antwort

dbmn
dbmn am 23 Mär. 2017
you might get an answer if you leave the decimal notation and go to binary. Here is a mini example
dec2bin(248) = 11111000
dec2bin(252) = 11111100
So bitand(redc, 248) gets you all but the last 3 digits of your redc.
dec2bin(bitand(bin2dec('10101011'), 248)) = 10101000
I assume that you store whatever Info you need in that 3 digits. Similarly bitand(redc, 7) will get you the last 3 bits with the desired info.
dec2bin(bitand(bin2dec('10101011'), 7)) = 00000011
You might play around with bitand and bitor for clarity.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by