POV-Ray : Newsgroups : povray.off-topic : How to break a simple "encryption"? : How to break a simple "encryption"? Server Time
28 Jul 2024 10:20:17 EDT (-0400)
  How to break a simple "encryption"?  
From: Lars Rohwedder
Date: 1 Jul 2014 08:23:47
Message: <53b2a853$1@news.povray.org>
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;
}


How many "x, encrypt(x)" pairs are necessary to reveal the 3 secret
constants? I think, 3 pairs should be enough, but am I right?

x=0x29ad711fdc0d4f4b  enc(x)=0x2453938ddf924a49
x=0x44626112006ce11b  enc(x)=0xe1ba98b582ec7899
x=0xc747d38561de6e54  enc(x)=0xa7d31873bc59182c

If you got the 3 secret values, you can reveal this pair, too:

x=0x51265200dfaaaa11  enc(x)=0x87461422********

Lars R.


Post a reply to this message

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