why is bitget not taking data?
3 次查看(过去 30 天)
显示 更早的评论
hello everyone i'm working on a project related with audio steganography i'm using 2 functions hide and recover in hide, i have used the following part of the code (bitset) and then write data inside the audio file:
identity=[1 0 1 0 1 0 1 0]';
%hide ID
dta(1:8)=bitset(dta(1:8),lsb,identity(1:8));
%hide req_msg & new_msg
dta(9:38)=bitset(dta(9:38),lsb,req_msg(1:30));
dta(39:38+r)=bitset(dta(39:38+r),lsb,new_msg(1:r)');
%>>>>>>>>>>> may help save('temp.mat','dta');
fid2=fopen('Stego-audio.wav','w');
fwrite(fid2,header,'uint8');
fwrite(fid2,dta,'uint16');
fclose(fid2);
but in recover, the bitget takes the bits from dta from the beginning until 38, but doesn't etract the bits from 38:39+r:
identity=bitget(dta(1:8),lsb)';
if identity==[1 0 1 0 1 0 1 0]
req_msg(1:30)=bitget(dta(9:38),lsb);
r=bi2de(req_msg);
secmsg_bin(1:r)=bitget(dta(39:38+r),lsb);
%secmsg_bin: The problem is here: we can extracrt the bits that give the
% the header, ID and the length for extraction... but the most important thing which is the message can't be obtained.. it's only an emtpy or zero matrix
the matrix "new_msg" which i want to recover, is a matrix of say (m*8) of zeros and ones ( in double).. plz let me know if anyone needs clarification.
3 个评论
Jan
2018-1-13
Could post a code which reproduces the problem? Maybe you made a mistake while obtaining dta from the file, but this part is not shown in the code yet. What do you get for dta(39:38+r) after the import? Does have the re-created r the correct value? Is "req_msg(1:30)" the same as "de2bi(r)"?
There are too many details which must be guessed. Therefore it is hard to find where your problem is coming from.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!