Code covered by the BSD License  

Highlights from
Embedding/ Hiding Image Within Image (with LSB encoding)

image thumbnail

Embedding/ Hiding Image Within Image (with LSB encoding)

by

 

20 Apr 2012 (Updated )

The objective is to illustrate how an image may be embedded or hidden within another given image.

maskLast_N_bits(dataInDec, N )
function dataInDecMasked = maskLast_N_bits(dataInDec, N )
%MASKLAST_N_BITS 
% 0 < N <= 8
bit8Mask = bin2dec('11111111');
bit8Mask_shifted = bitshift(bit8Mask, N); % left shift
bit8Mask = bitand(bit8Mask_shifted, bit8Mask);
dataInDecMasked = bitand(dataInDec, bit8Mask);

end

Contact us