POV-Ray : Newsgroups : povray.off-topic : How to break a simple "encryption"? : Re: How to break a simple "encryption"? Server Time
28 Jul 2024 10:13:55 EDT (-0400)
  Re: How to break a simple "encryption"?  
From: Le Forgeron
Date: 1 Jul 2014 09:30:49
Message: <53b2b809$1@news.povray.org>
Le 01/07/2014 14:23, Lars Rohwedder a écrit :
> I've seen a simple encryption like this:
> 
> uint64_t poor_encrypt(uint64_t x)
> {
>     x = x ^ SECRET1;
>     x = x * SECRET2;
>     x = x ^ SECRET3;
>     return x;
> }
> 
> the decryption is just the reverse:
> 
> uint64_t poor_decrypt(uint64_t x)
> {
>     x = x ^ SECRET3;
>     x = x * INVERSE_OF_SECRET2;
>     x = x ^ SECRET1;
>     return x;
> }
> 

Which value of Secret2 would allow the * (without overloading) to
reverse the value with a value of Inverse_of_secret2.

If * is not overloaded for uint64_t, I see only Secret2 = 1 as valid if
the original code uses the whole 64 bits range.

Therefore either the encrypt/decrypt is a simple xor of a single 64 bits
(you won't get Secret1 and Secret3, but (Secret1|Secret3)), or the * is
overloaded and we need to known more about that operation.



-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.