MATLAB: LSB steganography matlab program

lsbsteganography

I make LSB steganography program to extract message, but the result of program is the message not same with the plaintext in the embedd program. please help me if you can clear it, thanks 🙂
clear all;
close all;
I = imread('steg1.bmp');
end_char = '@';
text_back = [];
for i = 1:8:numel(I)
C = bitget(I(i:i+7),1);
C = bin2dec(num2str(C));
if(C == end_char)
break;
else
text_back(end+1) = C;
end
end
text_back = char(text_back);
%%Display
subplot(1,2,1);
title('Original');
imshow(imread('dorin.jpg'));
disp(text_back);

Best Answer

  • Here's one that works with images. It's probably easy to adapt it.