So you want to decrypt switch content ? Well, the good news is that all the tools required to do that are written up! The great news is, since this is crypto we're talking about, you'll have to find the keys. Yourself. Like it's easter.
So here you can find a template of the $HOME/.switch/prod.keys
file that hactool uses to decrypt content. It contains all the SHA256 and location of the keys and seeds, so you can find them yourselves.
Note that all the seeds (the keys that end with _source
) are used along with the master_key_##
to derive an actual key.
If you have somehow obtained the key without the seed, you can rename xxx_source
to xxx_##
(where ## is the master key number) and put your key there.
This section will not work on 7.0.0. If you want to dump the keys, downgrade to 6.2.0. Or find an exploit. Who knows, maybe you're actually really good at Reverse Engineering and you never knew?
A lot changed in the couple last days. We now have the ability to do Fun Stuff. Here's what you need:
- A dump of your BOOT0 partition.
- Your console's SBK/TSEC key.
- If you're on 6.2.0+, the tsec_root_key.
- Your decrypted package1 file.
- Your package2 file.
All of those are obtainable via hekate.
First, you'll want to find the keyblob_key_source
, keyblob_mac_key_source
and master_key_source
. With those, hactool's keygen option will gain the ability to derive the master_key
. On 6.1.0 and under, you'll also get the package1_key
, with which you can decrypt the encrypted parts of package1
(RTFM on how to do that). On 6.2.0+, package1 can only be decrypted from a real console, so use hekate to dump it. Then, you'll want to find the package2_key_source
. And finally, everything else.
Here's a quick reminder of the versions:
master_key_00
: 1.0.0-2.3.0master_key_01
: 3.0.0master_key_02
: 3.0.1-3.0.2master_key_03
: 4.0.0-4.1.0master_key_04
: 5.0.0-5.1.0master_key_05
: 6.0.0-6.1.0master_key_06
: 6.2.0master_key_07
: 7.0.0-7.0.1
Good luck with The Hunt. And remember: We believe in your habilities.
-
Q: The hashes are wrong !
A: You are computing it wrong. Hex is only a representation. Binary is truth. Because I'm such a nice guy, I'll tell you this :
SHA256(00FF00FF) = 7a7bf454c5f3cb1b9d9a20f81417f98d976fe3b3dd52c1b9968f02e89e7e8a2f
-
Q: Is the order important?
A: Yes, if you don't want to use leaked keys, they are! And you don't want to use leaked keys, do you? Tsktsk.
Here's why the order is important:
keyblob_key_source
,keyblob_mac_key_source
andmaster_key_source
gives package1_keypackage1_key
is used to decryptpackage1
, which containsSecure_Monitor.bin
, in which you'll find some key sources andpackage2_key_source
.package2_key_source
andmaster_key
are then used to decryptpackage2
, which contains everything else.
-
Q: How do I get my console's SBK/TSEC ?
A: Take a look at fusee-launcher and biskeydump. Those two tools should give you what you want.
-
Q: How do I get my hands on the package1/package2 ?
A: Those two files are both located in the
0100000000000819.bin
archive, which you can easily dump with pegaswitch. Look at the dumpArchive.js script.If pegaswitch isn't an option for you, you can also get them from a NAND backup.
package1
is located at a fixed offset in BOOT0, andpackage2
is at a fixed offset in BCPKG2-1-Normal-Main. Check the wiki out. You can write a script to extract those files. It's easy, I swear! -
Q: RTFM ?
A: Read The Fucking Manual.
./hactool --help
will tell you everything else you need. -
Q: Can you just cut the chase and give me the keys ?
A: No. I enjoy watching you suffer.
How about the eticket_rsa_kek_source?
That's necessary for getting your personalized titlekeys.