When Fully Licensed GmbH published details of its analysis of Microsoft's Windows Product Activation (WPA) system earlier this week, it had deliberately removed a small piece of the picture. The company made a fully-working executable of its XPDec utility available for download along with the XPDec source code, but it removed the encryption key from the source.
It seems, however, that this is only a minor obstacle for anyone wishing to have the complete source; The Register has been passed an explanation of how it can be restored, and it really sounds quite simple:
In main.c, there's a function called KeyedHash. From the source:
static unsigned char Key =
#error The key has been removed from the source code. Please obtain the executable.
Since the key is 4 bytes long, simply insert the 4-letter word of your choice, and compile the project (I was thinking of our good friend Mr Gates when I thought up mine)
static unsigned char Key =
This produces an almost identical .exe file, which with the aid of a hex editor can then be compared to the downloaded .exe, and this allows you to zero in on the key.
But what is the point of having it? It is not in itself, according to our informant, the key to the gates of heaven. It doesn't allow you to get around WPA directly; what it does is encrypt the already-hashed part of the data, including the hardware data, when XP is generating a product key to be verified.
He suggests: "What it does allow you to do is generate vast numbers of arbitrary product IDs, which you can then (if you're clever) trick MS into giving you the unlock codes for. If you have access to a ready supply of Windows serial numbers (ie a corporate network), you can feed them in, activate them with different hardware data until they are exhausted, and get lots and lots of corresponding unlock keys."
So it begins to sound interesting, and maybe Microsoft does have some kind of security headache here. He continues: "With a bit of reverse engineering (well, maybe quite a lot), some hacking around with the various encryption algorithms used, and a lot of patience, you should (theoretically) be able to create an app that will give you the unlock code for any arbitrary product key; obviously this process will be greatly simplified with the addition of more sample data."
Not that it's necessarily going to be even that easy: "If MS are not entirely stupid, they should have implemented some kind of public-key cipher (RSA would be ideal) for the unlock codes; MS would encrypt the 'OK' message with their private key, and the client would use the freely-available public key to verify it. Even so, most of the public-key algorithms used suffer from some kind of weakness given enough sample data; it's also dependent on them implementing it properly."
At the very least, this opens up intriguing possibilities. ®