PDA

View Full Version : Help with reverse of function


pacman730
03-31-2011, 03:10 PM
Hello,

I'm new to this forum, but I'm not new to reverse engineering.
I want to create a keygen for a program and I managed to create a python script that does the validation of name/key pair exactly like the program does.
Here is a part of the script that I need help with http://pastebin.com/fGQ2AQ1S (and the dump.txt file http://www.megaupload.com/?d=2M4UXT6G, if you need another link please let me know ).

I need help understanding what the decode function does and if it can be reversed. I need to get the bits100 when I now only the table variable.
Is it even reversible? Or is it a decode function of some asymmetric encryption algorithm and the data in dump.txt is the public key?

If you need an explanation of the python script please let me know.
Thank you.

zementmischer
05-05-2011, 11:53 AM
I'll try to give an answer, even though my conclusions might be totally wrong...

First: i don't have seen anything like this before - it looks like a convolutional code which are normally used as error-correcting code in telecommunications (but definitely not with a ratio of 5056:1).

Just some facts:
the input consists of 56880 bytes -> 455040 bits
your ouput table is 96 bits, but only the first 90 bits are actually used
you have a boolean function of 100 variables which maps 5056 bits to 1 bit in the output table, hence 90 bits * 5056 bits = 455040 bits (56880 bytes)

If i'm right this kind of problem is called SAT (boolean satisfiability problem) and is known to be NP-complete.
Therefore i don't think it's reversible.
You're only option might be to brute-force the 100 bits or to use an SAT-Solver like MiniSAT (http://minisat.se/)

just my 2 cents...