nicoboss/nsz

Clarification about master_key numbering system

Clearmist opened this issue · 2 comments

NSZ 4.6.1 is looking for master_key_10 in prod.keys, but the hash is actually named master_key_0a when dumped by LockPickRCM.

master_key_10 missing from C:\Users\{user}\.switch\prod.keys! This will lead to corrupted output.

This problem was referenced in blawar's nut repository where the fix was renaming from 10 to 0a since 10 is decimal and 0a is hex.

#144 is the pull request that added master_key_10.

As of the most recent firmware, the master_key_* hashes are:

  • master_key_00
  • master_key_01
  • master_key_02
  • master_key_03
  • master_key_04
  • master_key_05
  • master_key_06
  • master_key_07
  • master_key_08
  • master_key_09
  • master_key_0a
  • master_key_0b
  • master_key_0c
  • master_key_0d
  • master_key_0e
  • master_key_0f

@Clearmist Take a look at

crc32_checksum = {
as you see that we indeed already reached master_key_10 which you are missing. It is correct that after master_key_09 comes master_key_0a but we where at master_key_0f after which comes master_key_10 as the hexadecimal system is used to count them. I already fixed the master_key_0a issue on Apr 28, 2020 in #68 almost 4 years ago. To fix your issue just upgrade your Nintendo Switch to the latest firmware and dump your keys. Here all the key hashes:

crc32_checksum = {
	'aes_kek_generation_source': 2545229389,
	'aes_key_generation_source': 459881589,
	'titlekek_source': 3510501772,
	'key_area_key_application_source': 4130296074,
	'key_area_key_ocean_source': 3975316347,
	'key_area_key_system_source': 4024798875,
	'master_key_00': 3540309694,
	'master_key_01': 3477638116,
	'master_key_02': 2087460235,
	'master_key_03': 4095912905,
	'master_key_04': 3833085536,
	'master_key_05': 2078263136,
	'master_key_06': 2812171174,
	'master_key_07': 1146095808,
	'master_key_08': 1605958034,
	'master_key_09': 3456782962,
	'master_key_0a': 2012895168,
	'master_key_0b': 3813624150,
	'master_key_0c': 3881579466,
	'master_key_0d': 723654444,
	'master_key_0e': 2690905064,
	'master_key_0f': 4082108335,
	'master_key_10': 788455323
}

Oh! I didn't know we'd made it that far. Thanks for the reply :)