Changes

Jump to navigation Jump to search
10 bytes removed ,  05:34, 1 November 2012
no edit summary
Line 10: Line 10:  
So how do you use this to decrypt a savegame on a 3DS? First off, you chunk up the savegame into 512 byte chunks. Then, you bin these chunks by their contents, discarding any that contain only FF. Now look for the most common chunk. This is your keystream. Now XOR the keystream with your original savegame and you should have a fully decrypted savegame. XOR with the keystream again to produce an encrypted savegame.
 
So how do you use this to decrypt a savegame on a 3DS? First off, you chunk up the savegame into 512 byte chunks. Then, you bin these chunks by their contents, discarding any that contain only FF. Now look for the most common chunk. This is your keystream. Now XOR the keystream with your original savegame and you should have a fully decrypted savegame. XOR with the keystream again to produce an encrypted savegame.
   −
All gamecard and NAND/SD savegames are encrypted with AES-CTR. The gamecard savegame [[AES|keyslot]] keyY is unique per gamecard. This keyY is unique for every region of each game. Flags stored in the [[NCSD]] determines the method used to generate this keyY. These same flags are also used for determining which CTR period is used as well.
+
All gamecard and SD savegames are encrypted with AES-CTR. The gamecard savegame [[AES|keyslot]] keyY is unique per gamecard. This keyY is unique for every region of each game. Flags stored in the [[NCSD]] determines the method used to generate this keyY. These same flags are also used for determining which CTR period is used as well.
The base CTR for gamecard savegames is all-zero. NAND/SD savegames use a CTR where the base CTR is fixed per savegame, however the CTR doesn't repeat in the image.
+
The base CTR for gamecard savegames is all-zero. SD savegames use a CTR where the base CTR is fixed per savegame, however the CTR doesn't repeat in the image.
    
With system version [[2.2.0-4]] the system can now use a different gamecard CTR method, which fixed the above flaw. With [[2.2.0-4]] the system checks a [[NCSD]] flag, when it's set the new CTR period is used, otherwise the 0x200-byte CTR period is used. All games released since [[2.2.0-4]] have this flag set. The new CTR period may be 0x1000-bytes.
 
With system version [[2.2.0-4]] the system can now use a different gamecard CTR method, which fixed the above flaw. With [[2.2.0-4]] the system checks a [[NCSD]] flag, when it's set the new CTR period is used, otherwise the 0x200-byte CTR period is used. All games released since [[2.2.0-4]] have this flag set. The new CTR period may be 0x1000-bytes.

Navigation menu