Microsoft CD Key Authentication Revealed!
Written by Donald Moore (MindRape)
(You won't see this on their MSDN Level 2 CD!)
Abstract
This document will cover details about what makes up a Microsoft CD Keys and how they are authenticated.
With the rush in of Windows'95, Microsoft has implemented a CD Key to either help foil piracy or to
track their software thoughout the world. It was brought to my attention by a Microsoft Production
Manager that they use this for their regional tracking, and also for product codes. They also
understand the weakeness of the key.
I find this a little bothersome. Here are some points:
- If you do not supply a valid CD Key, you cannot install the
software.
For all you people that claim Hit the ignore button,
that only appears in beta versions of Microsoft products
(besides too many
of you replied that very same message, looks like you downloaded too many
Windows'95 betas from the internet!).
It was also brought to my attention by R. Pickett, that upgrade versions of
Windows'95 allow you to use the Ignore button, but require that you
have an older version of Windows installed.
- My Plus Pack and Visual Basic Professional, they both share the same
first 3 digits.
How does this seperate the 2 products?
People on the other side of the United States have the same first 3
digits of some of my software. What? Is Microsoft only tracking by
continent now? Is there really a sequence to the last seven digits that can be recognized as a regional code?
If you can answer these questions please inform me!.
In either case, the CD Key is real a hassle on my part. I either lose the cases or my kids eat the
sticker. Great how am I suppose to reinstall my software when my system crashes? Also if this IS
being used as a scheme to foil piracy. It doesn't work, because one can easily copy the CD as well as the key.
C Source code is provided to show how a key can be authenticated.
CD Key Details
- CD Keys are interchangable between Microsoft Products employing this scheme. This means you can take your Windows'95
CD Key and reuse it on your Microsoft Office Professional CD. This also works with Developer Level 2 and
Level 3 CDs.
- CD Keys contain alphanumeric characters, however the REAL key only contains numbers (0..9). There are 2 types of keys
being used at the moment. One is direct sales from Microsoft, we will call these MS Keys. The other is when you buy your
computer and it comes prestock with Microsoft software, we will call these OEM Keys.
In the first 3 characters of a MS Key or the first 8 characters of a OEM Key bear no value in authenticating the key itself. The
next 7 characters are the key. Anything after that is more garbage. Perhaps this garbage is really a product code, OEM
licensing information or just really garbage!
Example of a MS Key
Example of an OEM Key
- The last 7 seven digits is the real key. In the OEM version of the key its
the 3rd set of digits, but the LAST 4 digits of the key. The first 3 digits
of the key in the OEM verson must be zero.
It was discovered that the digits
do not need to follow a certain sequence. For example the key XXX-0123456 can simply be reverse to produce XXX-6543210
will still result in a valid key!. By this the demonstration we can conclude that the validation routine is either XOR or SUM based.
It was later verified that it was a SUM validation routine.
Key Authentication
The algorithm to the authentication routine is a VERY simple one. One can write a small amount of
source code that will randomly generate valid CD Keys.
Lets use the following key as an example: 666-0077640 (Lucky Number 7's MS Key)
- Strip off the 1st 3 digits.
- Take each digit left over and add them together.
0 + 0 + 7 + 7 + 7 + 0 + 0 = 21.
- Now take the result modulos by 7. If value is 0 then the key is
consider to be a authentic Microsoft CD Key. Note that the algorithm is
MODULOS, not DIVISION, because the key 000-0000000 is
consider
to an authentic MS CD Key. You cannot take the sum of the real
key and divide it by 7. You would get a division by 0 exception.
21 / 7 = 3.0
© 1995 Damaged Cybernetics