this is apart from a code for image encryption using chaotic map, please help me to know what is the wrong with this code
3 views (last 30 days)
Show older comments
x(1)=0.2350;
y(1)=0.3500;
z(1)=0.7350;
a(1)=0.0125;
b(1)=0.0157;
l(1)=3.7700;
image_height=256;
for i=1:1:70000
x(i+1)=l*x(i)*(1-x(i))+b*y(i)*y(i)*x(i)+a*z(i)*z(i)*z(i);
y(i+1)=l*y(i)*(1-y(i))+b*z(i)*z(i)*y(i)+a*x(i)*x(i)*x(i);
z(i+1)=l*z(i)*(1-z(i))+b*x(i)*x(i)*z(i)+a*y(i)*y(i);
end
x=ceil(mod((x*100000),image_height));
y=ceil(mod((y*100000),image_height));
z=ceil(mod((z*100000),image_height));
original=imread('peppers.png');
rgb=rgb2gray(original);
[row,col]=size(rgb);
n=500;
p=600;
q=700;
for j=1:1:row
k(j)=x(j+n);
l(j)=y(j+p);
end
% for i=1:1:row
% k(i)=x(i+n);
% end
% for j=1:1:col
% l(j)=y(j+p);
% end
for j=1:1:col*row
m(j)=z(j+q);
end
please i want to know what's the error in the last command line " m(j)=z(j+q);"
when i run i got error in this line , please help me
7 Comments
Rik
on 4 May 2021
@DGM That is actually what allows this discussion. If this code wasn't fundamentally broken it would be a question about implementing cryptography, which is classified as a weapon in US law (yes, seriously). Discussing it on a website that can be reached from outside of the US is considered as a weapons export, which requires permission being granted prior to publishing.
It is a stupid system that makes no sense in this case, but since the Mathworks website is governed by US law, in general discussions about cryptography aren't allowed. (although there is hardly any enforcement of this rule, for more context, see this thread)
DGM
on 4 May 2021
Yeah, I figured I wouldn't bring it up. The ridiculousness of reality needs no aid to stay in memory.
Answers (0)
See Also
Categories
Find more on Encryption / Cryptography in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!