dimanche 29 mars 2015

Decryption of encrypted values with the repeated squaring algorithm



I have the following encryption algorithm and I want to know how to get the original value from the "Result" variable after exiting the loop.



InBytes = 2820389213912491205;
Result = 1;
Val = 0x3419;
while(Val != 0)
{
if( (Val & 1) == 1)
{
Result = Result * InBytes; //Val is odd
}
InBytes = InBytes * InBytes;
Val = Val / 2;
}


I would be glad if you could also link me to a source code example of the decryption algorithm.


P.S : The encryption is done on 64-bit values so bruteforce isn't really an option here.




Aucun commentaire:

Enregistrer un commentaire