-2
$\begingroup$

I am working on some image encryption algorithm and got stuck.

I have plaintext data value of $256$ and perform the following (all values in decimal):

$$[256 \oplus 2] mod (256) = 0$$

What will be the equation to decrypt the ciphertext $0$?

EDIT - Sorry...I actually intend to do mod 2 and not mod 256 if the answer of $[x \oplus 2]$ exceeds 256. I realized I'll just have to workaround this problem, since the '0' is not an acceptable value in my program. Thanks...

$\endgroup$
1
  • 2
    $\begingroup$ The given equation evaluates to false and there are no variables in there so it can never be true. $\endgroup$
    – SEJPM
    May 22, 2017 at 11:22

1 Answer 1

3
$\begingroup$

You can either try to grasp what @SEJPM already commented:

The given equation evaluates to false and there are no variables in there so it can never be true.

Or you can look at it in an even more simple way:

Your formula is wrong in the first place since $256 \oplus 2 \pmod {256} = 2$ and not $0$ as you imply.

Check the sub-steps:

$256 \oplus 2 = 2 \\2 \pmod {256} = 2$

Therefore

$256 \oplus 2 \pmod {256} \ne 0$

As your formula does not have any variable that might explain how $256 \oplus 2 \pmod {256}$ would result in $0$, the formula doesn't really make sense from a mathematical point of view.

Things would be different if your formula would have read either $x \oplus 2 \pmod {256} = 0$ or something like $256 \oplus 2 - x \pmod {256} = 0$, but that's obviously not the case in your Q.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.