error when I execute RGB scrambling
이전 댓글 표시
I want to do RGB scrambling as part of image cryptography. While executing a code, I got an error message
"Subscript indices must either be real positive integers or logicals".
The code is given below;
iscram=cipher;
N=256;
T=1.4938*N+40.8689;
disp(T);
t=0;
T2=ceil(T);
disp(T2);
c=[T];
while t<T2
for i=[0:N-1]
for j=[0:N-1]
iscram(i,j)=iscram(mod(i+j,N),mod(i+(2*j),N));
end
end
t=t+1;
end
How do I solve this. Can anyone help me?
채택된 답변
추가 답변 (1개)
Image Analyst
2018년 9월 22일
1 개 추천
That looks like it's Arnold's cat map. See my Arnold's cat map demo, attached.
댓글 수: 6
A.Mariya Jomet
2018년 9월 24일
A.Mariya Jomet
2018년 9월 24일
Walter Roberson
2018년 9월 24일
Due to the laws of the United States, we cannot assist you on "encryption". On the other hand, we can suggest that some people are interested in the mathematical properties of "chaotic maps" such as the Arnold Cat Map.
A.Mariya Jomet
2018년 9월 24일
Image Analyst
2018년 9월 24일
편집: Image Analyst
2019년 7월 28일
The Arnold's cat map is a way of scrambling, not encrypting, the image. I'm not changing the values really, just rearranging them. The original values are all still there. If you repeatedly run my cat map demo on the output, eventually the original RGB image will be recovered. So it's cyclic, periodic. After each iteration, you should get a scrambled image. Eventually you will see the original image displayed. Not sure what you meant by not getting any results - it should show a series of images - one at each iteration - like below.

For the toysflash.png demo image, you'll see in the command window:
Back to Original after 68 Iterations.
Elapsed time = 8.3 seconds.
A.Mariya Jomet
2018년 9월 25일
카테고리
도움말 센터 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!