Repository navigation
Setup Key File
StreetPass links are encrypted, and the encryption key is derived from secrets stored in every 3DS. ctrpass needs those secrets from your own console. They all go into one text file, the key file.
The key file is generated from your dumped aes_keys.txt, StreetPass system module dump and CEC save data dump.
| Entry | Size | Required | Used for |
|---|---|---|---|
slot0x2EKeyN, or both slot0x2EKeyX and slot0x2EKeyY
|
16 bytes | Yes | Encrypting the link key. |
streetpassHmacKey |
16 bytes | Yes | Deriving each link's key. |
titleKeyXXXXXXXX |
32 bytes | Yes | Signing messages for the game with that CEC title ID, e.g. titleKey00020800 for StreetPass Mii Plaza. |
slot0x31KeyN, or slot0x31KeyX and slot0x31KeyY
|
16 bytes | No | Reading and building Mii records. Needed for Mii Plaza messages. |
These steps require GodMode9 on a console with custom firmware.
1. aes_keys.txt: AES keyslots
Contains `0x2E` and `0x31` keys.
- Start GodMode9 on your modded (boot9strap) 3DS.
- Hold START while booting and select GodMode9 if prompted.
- Run the 'DumpKeys' script, which exports `sdcard/gm9/aes_keys.txt'.
- Press HOME -> Scripts... -> DumpKeys
- If missing, download DumpKeys
and place in
<3DS SD Card>/gm9/scripts/
- Insert SD Card and copy
<3DS SD Card>/gm9/aes_keys.txtto your computer.
2. cecd: StreetPass system module
Used for getting the HMAC key constant. On your console, with GodMode9 open (see 1.)
- Open the NAND Title manager
- Press HOME -> Title manager -> [1:] NAND / TWL
- A list of system apps and titles should appear.
- Find the 'cecd' entry.
- Look for
0004013000002602 (1125pseg-ciuser)
- Look for
- Select the entry and open the title directory
- Press A on that entry you found.
- Select 'Open title folder'
- Extract
cecd'scode.bin- Press A on '00000016.app'
- Press NCCH image options... -> Extract .code
- If done correctly, your SD card should contain
gm9/out/0004013000002602.dec.code
- Copy to your computer and rename to
code.bin- Insert the SD card into your computer and put the '...dec.code' file you dumped somewhere safe
with the file renamed to 'code.bin', e.g. at
~/code.bin
- Insert the SD card into your computer and put the '...dec.code' file you dumped somewhere safe
with the file renamed to 'code.bin', e.g. at
3. cec-save.bin: CEC save data partition
On your console, with GodMode9 open (see 1.)
- Open the NAND filesystem
- Navigate to '[1:] SYSNAND CTRNAND' in the GodMode9 main menu.
- Go to
data/[yourid]/sysdata/00010026directory- You should see one file: '00000000'
- Mount CEC partition
- Press A on '00000000'
- Select 'Mount as DISA image'
- Press A for yes to enter the path of the mounted CEC partition.
- Copy
partitionA.binto your SD card- If mounted correctly, you should see 'partitionA.bin'
- Press A on this file and 'Copy to 0:/gm9/out'.
- Copy to your computer and rename to
CEC-partition.bin- Insert the SD card into your computer and put the 'partitionA.bin' file you dumped somewhere safe with the file renamed to 'cec-save.bin'
Copy the files to your computer, preferably to the same directory, they can be safetly removed afterwards.
ctrpass keys reads the module and the save, finds the keys, and appends them to the key file.
mkdir -p ~/.config/ctrpass
cp aes_keys.txt ~/.config/ctrpass/keys
cp partitionA.bin cec-save.bin
ctrpass --keys ~/.config/ctrpass/keys keys --module code.bin --titles cec-save.bin-
--modulefindsstreetpassHmacKey. If ctrpass reports that no key string was found, the module is still encrypted or compressed. Extract it again. If the search fails on a correctly decrypted module, pass the key's file offset with--offset. -
--titlesreads the signing key of every game in a CEC save data partition or CEC folder. It can be given more than once. - Without
--keysorCTRPASS_KEYS, the command writes to~/.config/ctrpass/keys.
The file is written so only your user can read it. Keep it private as it holds your console's keys.
-
Command line: pass
--keys PATH, or setCTRPASS_KEYS=PATH. - Desktop app: choose the file in Preferences -> Keys -> Key file. The row then shows how many games it has signing keys for.
Next: First exchange with the desktop app or First exchange from the command line
How to set up
- Overview and requirements
- Choosing a Wi-Fi adapter
- Building and installing
- Making the key file
- Desktop app
- Command line
- Messages and emulators
- Troubleshooting
Plugins
Protocol
- Overview
- Discovery
- Link setup
- Frames and CCMP
- YY transport
- Exchange flow
- Exchange objects
- CEC messages
- CEC message boxes
- Mii records
- Mii Plaza
- Keys
ctrpass library
Linux