Explanation for LSB data hiding
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Elysi Cochin
      
 el 23 de Mzo. de 2017
  
    
    
    
    
    Respondida: dbmn
      
 el 23 de Mzo. de 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
0 comentarios
Respuesta aceptada
  dbmn
      
 el 23 de Mzo. de 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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Data Type Conversion en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

