why is bitget not taking data?
古いコメントを表示
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 日
The question is not clear yet. What is "r" in the first code?
Which one is the most important thing you want to get? How can it be empty or zero matrix - only one of them is possible, isn't it?
What do you get as value of "r" in the 2nd code?
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 件)
カテゴリ
ヘルプ センター および 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!