0% found this document useful (0 votes)
33 views1 page

If Else End For If Else End If End End: Changes in Code

The document contains code for encrypting data. It uses a logistic map algorithm to generate pseudorandom numbers which are then used to encrypt data. The code generates two encrypted keys (h1 and h2) by running the logistic map algorithm with different parameters, then performs an XOR operation on the two keys to generate the final encrypted data (h).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

If Else End For If Else End If End End: Changes in Code

The document contains code for encrypting data. It uses a logistic map algorithm to generate pseudorandom numbers which are then used to encrypt data. The code generates two encrypted keys (h1 and h2) by running the logistic map algorithm with different parameters, then performs an XOR operation on the two keys to generate the final encrypted data (h).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Changes in code:

%----------------------------- [encryption] -------------------------------

s=zeros(1,m*n);
xn1=zeros(1,m*n+500);
if(x1_<0.5)
xn1(1) = mod(((a1_*x1_*(1-x1_))+((4-a1_)*x1_/2)) , 1);
else
xn1(1) = mod(((a1_*x1_*(1-x1_))+((4-a1_)*(1-x1_)/2)) , 1);
end
for i = 2:m*n+500
if(xn1(i-1)<0.5)
xn1(i) = mod(((a1_*xn1(i-1)*(1-xn1(i-1)))+((4-a1_)*xn1(i-1)/2)) , 1);
else
xn1(i) = mod(((a1_*xn1(i-1)*(1-xn1(i-1)))+((4-a1_)*(1-xn1(i-1))/2)) , 1);
end

if(i>500)
s(i-500)=xn1(i);
end
end
% i = 1:m*n;
% plot(i,s);
% axis([0 50000 0 1]);
h1 = ceil(mod(s*(10^15),256));
h1 = uint8(reshape(h1,[m,n])); %Final Key(important)

s1=zeros(1,m*n);
xn2=zeros(1,m*n+500);
xn2(1) = mod(((a1_*x1_*(1-x1_))+((4-a1_)*sin(pi*x1_)/4)) , 1);
for i = 2:m*n+500
xn2(i) = mod(((a1_*xn2(i-1)*(1-xn2(i-1)))+((4-a1_)*sin(pi*xn2(i-1))/4)) , 1);
if(i>500)
s(i-500)=xn2(i);
end
end
% i = 1:m*n;
% plot(i,s);
% axis([0 50000 0 1]);
h2 = ceil(mod(s*(10^15),256));
h2 = uint8(reshape(h2,[m,n]));

h = bitxor(h1,h2);
%--------------------------------------------------------------------------

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy