-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCryptHarr.m
More file actions
32 lines (32 loc) · 779 Bytes
/
CryptHarr.m
File metadata and controls
32 lines (32 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
red=MainImg(:,:,1);
green=MainImg(:,:,2);
blue=MainImg(:,:,3);
redharr=waveletTransform(red);
greenharr=waveletTransform(green);
blueharr=waveletTransform(blue);
harr = cat(3, redharr, greenharr, blueharr);
ScrambledImage=randPermutator(harr);
red=ScrambledImage(:,:,1);
green=ScrambledImage(:,:,2);
blue=ScrambledImage(:,:,3);
red=bitxor(red,ImgKey);
green=bitxor(green,ImgKey);
blue=bitxor(blue,ImgKey);
Imaga=cat(3,red,green,blue);
figure;
imshow(Imaga)
title('Encrypted Image')
figure;
imhist(Imaga)
%Decryption
red=Imaga(:,:,1);
green=Imaga(:,:,2);
blue=Imaga(:,:,3);
red=bitxor(red,ImgKey);
green=bitxor(green,ImgKey);
blue=bitxor(blue,ImgKey);
Imag=cat(3,red,green,blue);
Imag=Unscrambler(Imag);
figure;
imshow(Imag)
title('Decrypted Image')