Home > other >  Who is a great god can help me have a look at this speech encryption code, the great god to reassure
Who is a great god can help me have a look at this speech encryption code, the great god to reassure

Time:09-22

[the file, the Fs]=audioread (' 1: m4a ');
The file (:, 2)=[]; % % double track respectively processing
Fs=8000;
X0=resample (file, fs, fs);
X2=dec_to_bin (x1); The decimal % will voice signal into two hexadecimal
% Logistic chaotic map, use of voice signal is encrypted
K1=0.3; U1=3.7; K2=0.6; U2=3.9; % set the initial value, namely the keys
Z1=k1; Z2=k2.
For m=8 80 times, 0% iteration reaches full chaotic state
Z1=z1 u1 * * (1 - z1);
End
For n=1:9 iterative 90 times, 0% at full chaotic state
Z2=z2 u2 * * (1 - z2);
End
A (1)=z1;
B (1)=z2;
% to produce a one-dimensional chaotic sequence encryption
For I=1: length (x0) - 1
A (I + 1)=u1 * a (I) * (1 - a (I));
B (I + 1)=u2 * b (I) * (1 - b (I));
End
A=zeros (length (x0), 1);
For j=1: length (x0)
If (a (j) & gt; B (j))
K=1;
The else
k=0;
End
A (j)=k;
End
B=dec_to_bin (A);
The x3=bitxor (bin2dec (x2), bin2dec (B)); % xor encryption operation, and get the ciphertext
X4=dec_to_bin (x3);

% % % % % % % % % % % % % % % % % decryption % % % % % % % % % % % % % % % % % %

% password, exclusive or work out with ciphertext expressly
K11=0.3; U11=3.7; K22=0.6; U22=3.9;

For m=8 80 times, 0% iteration reaches full chaotic state
K11 k11=u11 * * (1 - k11);
End
For n=1:9 iterative 90 times, 0% at full chaotic state
K22 k22=u22 * * (1 - k22);
End
Aa (1)=k11;
Bb (1)=k22;
% to produce a one-dimensional chaotic sequence encryption
For I=1: length (x0) - 1
Aa (I + 1)=u11 * aa (I) * (1 - aa (I));
Bb (I + 1)=u22 * bb (I) * (1 - bb (I));
End
AA=zeros (length (x0), 1);
For j=1: length (x0)
If (aa (j) & gt; Bb (j))
K=1;
The else
k=0;
End
AA (j)=k;
End
BB=dec_to_bin (AA);
X5=bitxor (x3, bin2dec (BB));
X6=bin_to_dec (dec2bin (x5))/1000;
Sound (x6)
There are two functions:
The function wavB=bin_to_dec (wavA)
WavB=bin2num (quantizer ([0] 8), wavA);
End
The function wavB=dec_to_bin (wavA)
WavB=num2bin (quantizer ([0] 8), wavA);
End
I want to know why when k11 u11 these parameters change can still be completed after decryption?? K1 is not equal to k11 normally can't produce the same sequence, also cannot decrypt, but change the parameters after k11 x5, x6 these values will change, but can still play the decrypted signal!! Why ah??
  • Related