Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SMM 2 > Encryption

Many files, such as level files and save data, are encrypted in Super Mario Maker 2.

These files start with an unencrypted header, followed by the ciphertext, followed by a footer. The size and format of the header and ciphertext depend on the file format.

The ciphertext is always encrypted with AES-CBC. The footer has the following structure:

OffsetSizeDescription
0x016Initialization vector
0x104 x 4Random number generator state
0x2016AES-CMAC of decrypted data

The encryption keys are generated with the ENL key generation algorithm. However, instead of initializing the random number generator with a specific seed, its internal state is initialized directly with the values from the structure above.

Two keys are generated with the RNG:

  1. A 16-byte key to decrypt the file body
  2. A 16-byte key to calculate or verify the CMAC

The integer table that is passed to the key generation algorithm depends on the file format.