Secret passwords in Pokémon Diamond, Pearl, Platinum, HeartGold, and SoulSilver
A hidden feature in these Pokémon games is the ability to tell a certain NPC four specific words or phrases using the easy chat system in order to unlock special rewards. Which words are required are unique per save file.
In Diamond, Pearl, and Platinum these rewards include 8 different special PC box wallpapers. The NPC to speak to is located on the 3rd floor of the Jubilife TV station.
In HeartGold and SoulSilver, rewards include 8 different PC box wallpapers plus 3 different Pokémon eggs. The NPC to speak to is located in the Violet City Pokémon Center.
The original distribution of these passwords was via the Pokémon Daisuki Club, a defunct, Japanese-exclusive official fan club website.
Below is both a calculator to generate the passwords for your specific save file, an in-depth explanation of how the password check system functions, and a full dump of the relevant word data.
How it works
The process to detect a set of 4 input words as a password to unlock a reward proceeds as follows:
- A list of special words (small subset of all selectable words) are designated as "password words". This list is unique per language and is hard coded into the ROM. See below for the lists of all of these words.
- The player's four input words are converted into their respective indices of the words in the password list. If the player selected any words not in the password list, the process fails.
- The four word indices are then encoded into four byte values, with this process:
- The first index must be 0-255. The 1st byte value is equal to the first index.
- The 3 remaining indices must not be 256 or more greater than the previous. For example, 5 cannot be followed by 300 as this is an increase of 295.
- Each index must not be less than the previous one, except in cases where the indices wrap around. For example, a 100 followed by a 90 is disallowed, but a 340 followed by a 20 is allowed as it is an increase of 31, if wrapping around to 0 at 351 (as is the number of words in English HeartGold).
- The 2nd through 4th byte values are the increase (or wrap-around increase) of each index compared to the previous one.
For example, word indices of [87, 156, 218, 18]
would be encoded to the bytes [0x57, 0x45, 0x3e, 0x97]
.
- The 4 byte values are now transformed using a nonlinear permutation process as follows:
- The 4 byte values are treated as a single 32-bit chunk, with the 1st byte being the most significant bits and the 4th byte being the least significant, and the chunk is rotated bitwise 5 bits to the right.
- The upper nybble of the 4th byte is XOR-ed against both nybbles of each of the other 3 bytes.
- The 1st, 2nd, and 3rd bytes are treated as a single 24-bit chunk, and are rotated bitwise to the right, similar to 3.a., except by a distance defined by the lower nybble of the 4th byte.
- The 1st byte is XOR-ed against the 2nd and 3rd bytes.
For example, the bytes [0x57, 0x45, 0x3e, 0x97]
would be transformed to [0x64, 0x30, 0x39, 0xf4]
.
- The bytes are now checked to see if they are valid to unlock a reward as follows:
- The lower nybble of the 1st byte indicates which reward is unlocked. If it is outside the range of available rewards, the check fails.
- The 2nd and 3rd bytes, concatenated together, with the 2nd byte forming the most significant bits, must equal the trainer's ID.
- The upper nybble of the 1st byte must equal the magic number 6 (
0b0110
).
- The 1st byte, plus the 2nd byte, multiplied by the 3rd byte, must equal the 4th byte modulo 256.
- If all the checks pass, the reward defined in 4.a. is returned as unlocked.
For example, the bytes [0x64, 0x30, 0x39, 0xf4]
are valid to unlock reward number 4 for trainer ID 12345, with the magic number and checksum matching.
All of the steps are reversible, so the final state of the bytes may be arranged and then the steps performed backwards to arrive at the needed words.
In Diamond and Pearl, the process is largely the same, with these changes:
- The table of special words described in 0. is not a specific list; instead, words from the category groups
STATUS
, TRAINER
, PEOPLE
, LIFESTYLE
, FEELINGS
are concatenated together, with duplicates not removed, and multiple attempts made to check for all combinations of duplicates (for example, the word "SIMPLE
" appears in both STATUS
and FEELINGS
categories).
- The bitwise rotations in 3.a. and 3.c. are performed to the left instead of to the right.
- The rotation distance used in 3.a. is 7 bits instead of 5 bits.
- The magic number specified in 4.c. is 0 (
0b0000
) instead of 6 (0b0110
).
- The check process in 4.d. is skipped entirely. This results in multiple word options being valid for each reward, depending upon the bits in the 4th byte (256 possible options). There is no functional difference at all between these options. The above calculator always sets this 4th byte to
0x00
.