Product Keys and Hashing

Product keys are yielded by purchasing Blizzard games. There are three types of keys varying in length and character masks.

Length Character Mask Description
13 0123456789 These keys contain only numbers, of which the thirteenth is a checksum to validate the other twelve, used by older Starcraft releases. These keys are no longer sold by Blizzard and can be easily generated with a high yield of success.
16 246789BCDEFGHJKMNPRTVWXZ These keys are used by older copies of Warcraft II, Diablo II, and Lord of Destruction. These keys are no longer sold by Blizzard.
26 246789BCDEFGHJKMNPRTVWXYZ These are the more modern keys; currently this is the scheme used and sold by Blizzard, including for newer games. These keys use the same mask as 16-length keys but with the inclusion of the Y character.

Note that none of these keys' masks contain dashes/hyphens, dots, spaces, or any sort of punctuation. Any character outside of these masks with these specific lengths should be trimmed.

Each key is the result of an algorithm to encode three values, commonly referred to as the Product, Public, and Private key values. The Product and Public values are sent raw to the server as part of the connection, as well as a hash of all three, allowing the server to verify the key as a legitimate match without the opportunity of theft. This is done in the SID_CDKEY2 and SID_AUTH_CHECK messages. For the SID_CDKEY message, the key is passed as typed and is vulnerable to packet sniffing.

The Product value is used to identify the key's client, and relate as follows:

Product value Key length Product title Notes
0x01 13 Starcraft
0x02 13 Starcraft Opened later due to the success and continuing sales of Starcraft
0x04 16 Warcraft II
0x05 16 Diablo II Beta Defunct
0x05 26 Starcraft II Beta Defunct
0x05 26 WoW: Wrath of the Lich King Alpha Defunct
0x06 16 Diablo II
0x07 16 Diablo II
0x09 16 Diablo II Stress Test Defunct
0x0A 16 D2: Lord of Destruction
0x0B 16 D2: Lord of Destruction Beta Defunct
0x0C 16 D2: Lord of Destruction
0x0D 26 Warcraft III Beta Defunct
0x0E 26 Warcraft III
0x0F 26 Warcraft III
0x11 26 WC3: Frozen Throne Beta Defunct
0x12 26 WC3: Frozen Throne
0x13 26 WC3: Frozen Throne Product appears disabled and may have something to do with Chinese region
0x15 26 WoW: Burning Crusade
0x16 26 WoW: 14-day Trial
0x17 26 Starcraft Upgrade when Starcraft was released as a digital download and the game CD was removed from requirements to run the application
0x18 26 Diablo II Released at the same time as the 26-length Starcraft keys for same reason
0x19 26 D2: Lord of Destruction See 0x17 and 0x18
0x1A 26 WoW: Wrath of the Lich King
0x1C 26 Starcraft II
0x1E 26 Diablo III
0x24 26 Heroes of the Storm

For each key, the public and private value lengths differ, with the lengths usually being 32-bit unsigned integers, but with an 80-bit unsigned integer private value for 26-length keys.

Example code for encoding and decoding these keys is around, and RealityRipple would like to thank Yegg for his work in creating more efficient Key coding in the linked examples: VB.NET|Battle.net CD-Key Encoding/Decoding.

Jailout2000 has also provided an example to Realbasic programmers for encoding and decoding 13-digit keys: Realbasic 13-digit Key Encoder/Decoder.

Davnit has provided python implementations of decoding for each type of key: Python CD Key encoding

| Edited: RealityRipple

Comments

Caaaaarrrrlll

Nice reference. I give props to the VB.NET examples. Although I must add, where is the StarCraft II Wings of Liberty Demo Product Key? I only see the Beta and what looks like Retail versions.

RealityRipple

I don't have a copy of the game, but so far as I know, the SC2 guest pass keys use the same product value as the actual game, using the Public value to identify it as a guest pass (the two I examined started with 0x1EBA--).

Kyro

I'm surprised you don't have SC2, Andy. I have it, and so far, I'm definitely not disappointed. :)

Heinermann

Retrieved the following from the game installers:

0x05: 16-digit Diablo II Beta Key
0x06: 16-digit Diablo II Retail Key
0x07: 16-digit Diablo II Retail Key
0x09: 16-digit Diablo II Stress Test Key
0x0A: 16-digit Diablo II: Lord of Destruction Retail Key
0x0C: 16-digit Diablo II: Lord of Destruction Retail Key
0x0D: 26-digit Warcraft III: Reign Of Chaos Beta key
0x0E: 26-digit Warcraft III: Reign Of Chaos Retail Key
0x0F: 26-digit Warcraft III: Reign Of Chaos Retail Key
0x11: 26-digit Warcraft III: The Frozen Throne Beta key
0x12: 26-digit Warcraft III: The Frozen Throne Retail key
0x13: 26-digit Warcraft III: The Frozen Throne Retail key (NOTE: This product seems disabled? Has something to do with Chinese region)

Any conflicts are intentional. Product IDs that havn't been seen before are reserved by the appropriate installer.
Starcraft II and the other digital keys might also have reservations, but I havn't been able to really grab it from the installer.

Sixen

Added Heinermann's notes. Just need SC/BW Beta.

Should we include WoW Keys as well, since we're keeping track of SC2 Keys?

Heinermann

I think you should if the product, pubic, and private values are associated with it. AFAIK it is for any Blizzard key

Confirmation: The Starcraft Anthology digital installer uses product value 0x17, there are no reservations.
Confirmation: The Diablo II digital installer uses product value 0x18, there are no reservations.

RealityRipple

Um... pretty sure the WoW guest passes are 0x1B, but I'm not sure which copy of WoW.

RealityRipple

WoW TBC Retail: 0x15
WoW WotLK Retail: 0x1A

Sixen

Added.

Sixen

With that in mind then.. We need the following:

  • SC Beta
  • BW Beta
  • WoW Alpha/Beta/Retail/Guest
  • WoW TBC Alpha/Beta/Guest
  • WoW WotLK Alpha/Beta/Guest
  • WoW Cata Alpha/Beta/Retail/Guest
RealityRipple

WoW (14-day Trial): 0x16

Caaaaarrrrlll

Added.

Caaaaarrrrlll

Added a couple functions for encoding/decoding 13-digit keys in REALbasic. May be helpful, or maybe not...

RealityRipple

Diablo III: 0x1E

Caaaaarrrrlll

Added.

Caaaaarrrrlll

I've modernized this document using Markdown syntax.

Caaaaarrrrlll

Added Heroes of the Storm Beta key (public source, archive link 1, archive link 2)

Caaaaarrrrlll

Added WoW: Wrath of the Lich King Beta key from @Kaylin

galaxyhaxz

Thanks for the info. I would like to confirm the "D2: Lord of Destruction Beta" uses product code 0x0B, a 16 digit key. You can find info/download the LOD beta here: https://www.betaarchive.com/forum/viewtopic.php?f=16&t=35744

Caaaaarrrrlll

Info looks good. I'll add the code to the reference. Thanks galaxyhaxz!

silentknight

Hello,

I was just wondering does anyone hash anymore? If so, is there a tutorial on how to do it?

thanks,