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

1 visualización (últimos 30 días)
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

Respuestas (1)

Shounak Shastri
Shounak Shastri el 16 de Feb. de 2018
Editada: Shounak Shastri el 16 de Feb. de 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 comentario
Abubakar Abba
Abubakar Abba el 2 de Ag. de 2021
Editada: Abubakar Abba el 2 de Ag. de 2021
Nice. How about decrypting it to get back the original image using bitxor after applying the bitxor as stated?

Iniciar sesión para comentar.

Categorías

Más información sobre Encryption / Cryptography en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by