How to XOR the pixel values of image with a matrix containing decimal numbers?

1 vue (au cours des 30 derniers jours)
Sri Lakshmi
Sri Lakshmi le 16 Fév 2018
Modifié(e) : Abubakar Abba le 2 Août 2021
I am performing image encryption using key values of chaotic maps. I have converted the key values from vector into a matrix. The matrix size is 32*96 and the image is of size 32*96. I have to XOR each pixel of the image with the key present in the matrix. I am using color image. Thanks in advance

Réponses (1)

Shounak Shastri
Shounak Shastri le 16 Fév 2018
Modifié(e) : Shounak Shastri le 16 Fév 2018
_"I am using color image."_
Lets say your input image is I.
I = imread ('image.tif');
If you check the workspace after you execute this line, you would have
size (I) = [32 96 3];
The last 3 represents the Red, Green and Blue components of the image. You can use rgb2gray to convert it into a grayscale image. If you want to xor the colour image, then you would either need more chaos coordinates or you would have to use the same coordinates three times on the three planes saperately.
_"I am performing image encryption using key values of chaotic maps."_
Now, your chaos coordinates might be floating point numbers. So you can sort them by
[a, ind] = sort (chaosCoordinates);
Once you do this, you would have the chaotic values in "a" and their indices in "ind". You can now convert the vector of indices in a matrix of the size you need. This is easier than converting the chaos coordinates to integer values.
now you can simply do bitxor to get the encrypted image.
  1 commentaire
Abubakar Abba
Abubakar Abba le 2 Août 2021
Modifié(e) : Abubakar Abba le 2 Août 2021
Nice. How about decrypting it to get back the original image using bitxor after applying the bitxor as stated?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Encryption / Cryptography dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by