Should XOR operation performed on binary images only?

11 次查看(过去 30 天)
I want to perform XOR encryption and decryption on images.Should this operation performed on binary images only?

回答(2 个)

Guillaume
Guillaume 2015-6-5
编辑:Guillaume 2015-6-5
I assume this question came to be because you looked at the doc of xor in matlab and saw that it only applied to logical (binary / boolean) values. That's because xor is a logical operator.
It would be a bit pointless to have to binarise an image to be able to encrypt it. It certainly wouldn't be reversible anyway.
What you are looking for is the bit-wise xor, bitxor which can xor two integer bit xoring their corresponding bits.
encimage = bitxor(rawimage, somevalue)
%or
encimage = bitxor(rawimage, someotherimagethesamesize)

Rushikesh Tade
Rushikesh Tade 2015-6-5
I think so because XOR is binary operator.
  1 个评论
Anushka
Anushka 2015-6-5
I want to encrypt an RGB image with binary image using Xor and decrypt using XOR to generate the RGB image how can it be done

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Encryption / Cryptography 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by