Changes

Jump to navigation Jump to search
94 bytes added ,  14:18, 31 October 2015
More clarifications
Line 34: Line 34:  
The extended header, the [[ExeFS]], and the [[RomFS]] are encrypted using [https://github.com/3dshax/ctr/blob/master/ctrtool/ncch.c 128-bit AES CTR]. The decryption key is generated using the [[AES|AES Engine]] key generator, where the keyX is set by the bootrom (see below for the keyslots). Initially, the keyY was set to the first 0x10 bytes of the NCCH signature ("secure-crypto"). Later firmware updates introduced more sophisticated algorithms.
 
The extended header, the [[ExeFS]], and the [[RomFS]] are encrypted using [https://github.com/3dshax/ctr/blob/master/ctrtool/ncch.c 128-bit AES CTR]. The decryption key is generated using the [[AES|AES Engine]] key generator, where the keyX is set by the bootrom (see below for the keyslots). Initially, the keyY was set to the first 0x10 bytes of the NCCH signature ("secure-crypto"). Later firmware updates introduced more sophisticated algorithms.
   −
Starting with [[9.6.0-24|9.6.0-X]] Process9, there is a different method of generating the NCCH keyY which is enabled by setting the bitmask 0x20 in ncchflag[7]: The keyY will be set to a SHA256 hash generated with the data <0x10-long old-method keyY><0x10-long title-unique content lock seed>, where seeds for downloaded titles that use the new crypto are stored in [[Filesystem_services#SEEDDB|SEEDDB]] (nand:/data/<console-unique>/sysdata/0001000f/00000000). When FSUSER OpenFile is used with a NCCH archive where this crypto is used, fs-module will add the seed-data to the end of the [[FSPXI:OpenFile]] file lowpath with the seed from the SEEDDB (this is how Process9 gets the seed data which gets hashed for calculating the NCCH keyY). This new keyY generation is only used for [[RomFS]] and [[ExeFS]] files which don't have filenames "icon" or "banner" (the same sections which would be used for the additional NCCH keyslots, however this keyY generation can be used without any additional NCCH keyslot). This functionality was likely added to support pre-loading of games from the eShop.
+
Starting with [[9.6.0-24|9.6.0-X]] Process9, there is a different method of generating the NCCH keyY which is enabled by setting the bitmask 0x20 in ncchflag[7]: The keyY will be set to a SHA256 hash generated with the 0x20 bytes of data constituted by the old-method-keyY and a unique content lock seed (each of which are 0x10 bytes wide), where seeds for downloaded titles that use the new crypto are stored in [[Filesystem_services#SEEDDB|SEEDDB]] (nand:/data/<console-unique>/sysdata/0001000f/00000000). The decryption is transparent to ARM11 userland: When FSUSER OpenFile is used with a NCCH archive which uses this crypto, the FS-module will add the seed-data from SEEDDB to the end of the file lowpath used for [[FSPXI:OpenFile]], using which Process9 then gets the hash for calculating the NCCH keyY. It has been observed that this new keyY generation is only used for [[RomFS]] and [[ExeFS]] files which don't have filenames "icon" or "banner" (the same sections which would be used for the additional NCCH keyslots, however this keyY generation can be used without any additional NCCH keyslot). This functionality was likely added to support pre-loading of games from the eShop.
    
If a certain NCCH flag is set, a fixed AES key is used. There are two fixed keys, one for titles which have the system category bit set (SystemFixedKey), and one for the rest ("zeros" key). These are debug keys, as they aren't nomally supported on retail systems.
 
If a certain NCCH flag is set, a fixed AES key is used. There are two fixed keys, one for titles which have the system category bit set (SystemFixedKey), and one for the rest ("zeros" key). These are debug keys, as they aren't nomally supported on retail systems.
549

edits

Navigation menu