Skip to content

Password Structure

Robert Jordan edited this page Apr 30, 2019 · 8 revisions

Structure of a Letter

Letters have two categories, Valid and Garbage. There are 16 Valid Letters that represent the values 0-15, and 10 Garbage Letters whose values all represent zero for letters at certain indexes in the password.

Valid Letters

# Bin Hex Dec
Z 0000 0 0
A 0001 1 1
U 0010 2 2
E 0011 3 3
C 0100 4 4
G 0101 5 5
W 0110 6 6
J 0111 7 7
L 1000 8 8
H 1001 9 9
N 1010 A 10
P 1011 B 11
R 1100 C 12
T 1101 D 13
O 1110 E 14
X 1111 F 15

Garbage Letters

B D F I K M Q S V Y

These letters are a form of encryption to make the password structure harder to crack, all while making use of the remainder of the alphabet. Garbage letters are used to represent the value of Z (zero) for letters at certain indexes in the password.

Garbage letters can be freely switched with one another when entered into a password. The resulting save state will always be the same. Garbage letters will randomize every time you look at the password. The randomization is likely seeded by the timestamp on the Root Menu when the Password Menu is opened.

Structure of a Password

1 2 3 4 5 6 7 8
S SG SR C F FG FG FG
Description
S Scene ID
F Flag Data
C Garbage Checksum
G Garbage letter when zero
R Last two bits are random and ignored

Garbage Checksum

The garbage checksum is a single letter that is used to validate passwords by checking which letters are currently garbage letters. Each bit in the letter corresponds to a letter in the password that is a garbage letter when zero

Bit 3 2 1 0
Letter F8 F7 F6 S2

The password below has the first two as garbage letters, and the last two as valid letters. As such, the garbage checksum is E (0011), the first two bits are set while the last two bits are unset.

1 2 3 4 5 6 7 8
L KG A EC Z YG GG UG

The garbage checksum is the only part of the password that actually enforces if a letter needs to be represented with garbage letters. As such, user-created passwords can be greatly simplified by eliminating garbage letters altogether with the use of Z (0000) for the garbage checksum.

Invalid X

A bug in the Password Input Menu causes X to be an invalid garbage checksum by overwriting the 3 previously entered letters. See Propagating X Input for more information on this issue and how to solve it.

Flag Data

Flag Data is a set of 16 bits that the game uses to store variables used by scenes to determine the next scene to play. Identified flags can be found in Flags Operations.

Scene ID

Scene IDs are a number assigned to a Title-Chapter combination. They must be located in Scene Directory.

The value of the scene ID is structured as follows: --33 2222 1111 where each bit is the associated letter bit in the password, and - denotes the random unused bits as outlined below.

3rd Scene ID Letter

The last 2 bits in S3 are randomly generated when opening the Password Menu and can always be safely ignored. This letter is the highest part of the number and changes the least.

Below are all valid S3 letters, and what their real values are. Similar to Garbage Letters, each column contains letters that can be replaced with one another and still result in the same save state.

Z A U E
Z C L R A G H T U W N O E J P X

There are not enough Scene IDs for E to ever be reached, thus it is never accepted as valid input, nor should it ever appear in the password at S3.