Info

This question is closed. Reopen it to edit or answer.

I have a trouble in the final xor process .The o/p of the code should contain equal number of integer i.e)24.before that the element k2 and q should contain 192 bits after that only the xor operation will done.kindly reconstruct the code

1 view (last 30 days)
if true
clc;
clear all;
close all;
img = imread('cameraman.tif');
c=img';
d=c(:);
[W,L]=size(img);
k=randi(192,1,192);
syms k1 t
for i=1:4
k1=k(((48*i)-47):(48*i));
a1 = symsum(k1*(2^(t-(48*i)+47)),t,((48*i)-47),(48*i));
a=a1/(2^48);
end
for x=1:2
r(x)=mod(prod(a*(2^48)+a(x)),0.4)+3.6;
C(x)=mod(prod(a*(2^48)+a(x+2)),1);
end
C1=C(1);
C2=C(2);
for y=1:[W,L]
if y==1
C(y)=C(x);
else
if y~=1&&C(y-1)<0.5
C(y)=0.5*(r(x)*C(y-1));
else
if y~=1&&C(y-1)>=0.5
C(y)=0.5*(r(x)*(1-(C(y-1))));
end
end
end
end
for y=1:[W,L]
if y==1
E1(y)=d(y);
else
E1(y)=mod(d(y)+floor(C(y)*(10^13))+d(y-1),256);
end
end
for y=1:[W,L]
if y==[W,L]
E2(y)=E1(y);
else
E2(y)=mod(E1(y)+floor(C(y)*(10^13))+E1(y+1),256);
end
end
E2=E2';
Q=sum(E2');
Q=sym2poly(Q);
for j=1:192
q=dec2bin(Q,j);
kb=dec2bin(k,j);
end
k2=bitxor(kb,q);
k3=bin2dec(k2);
E=[1,(W*L)+24];
E={k2,E2}
end

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!