WIP [Tools] Derive Switch Keys

Discussion in 'Switch - Hacking & Homebrew' started by SocraticBliss, Apr 6, 2018.

  1. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Hey guys,

    Thought I would give something back to the community!

    I know that the application_area, package2, and titlekek keys are generated internally (via tools like hactool), but I wanted a quick way to generate those keys if I provide a master key + source keys.

    Edit:

    Now it has support for the following keys...

    package2_key_0X
    titlekek_0X
    key_area_key_application_0X
    key_area_key_ocean_0X
    key_area_key_system_0X
    header_key
    sd_card_save_key
    sd_card_nca_key


    this should be (temporarily) helpful for those who want to ever update their keys.dat file...

    https://github.com/socraticbliss/deriveSwitchKeys

    Feel free to submit additions to it, currently working on allowing you to import your dat file instead of manually having to enter the keys you have...
     
    Last edited by SocraticBliss, Apr 13, 2018
    lordelan, SrTommy, charlieb and 11 others like this.
  2. Oleboy555
    This message by Oleboy555 has been removed from public view by porkiewpyne, Apr 7, 2018.
    Apr 6, 2018
  3. Whovian NineThreeSixNine

    Whovian NineThreeSixNine Advanced Member

    Newcomer
    82
    41
    May 3, 2016
    United States
    Personal opinion: Replace the parathenses with other characters. I personally hate seeing \ appaear in my Shell. :P

    Otherwise, thank you for this! :D This is greatly appreciated!
     
  4. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Submit the change and I'll review it ;)
     
    x65943 likes this.
  5. Whovian NineThreeSixNine

    Whovian NineThreeSixNine Advanced Member

    Newcomer
    82
    41
    May 3, 2016
    United States
    Just removing the parathenses from the file name, was my thought ;P
     
  6. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Done ;)
     
  7. Whovian NineThreeSixNine

    Whovian NineThreeSixNine Advanced Member

    Newcomer
    82
    41
    May 3, 2016
    United States
    Thanks! Will definitely make stuff a little saner for me personally :P
     
  8. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Updated the script!

    Now it does all of the generated KEK keys :)

    key_area_key_application
    key_area_key_ocean
    key_area_key_system

    Next thing will probably be to allow people to import the file if they don't feel like re-entering the information after every push...
     
  9. salamandrusker

    salamandrusker Advanced Member

    Newcomer
    55
    16
    Mar 12, 2018
    Spain

    good job
     
  10. TiMeBoMb4u2

    TiMeBoMb4u2 GBAtemp Maniac

    Member
    1,423
    397
    Oct 25, 2008
    United States
    How many keys do you plan to implement?
    https://gbatemp.net/threads/number-of-switch-keys-dont-ask-for-them.499218/
     
  11. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Well, it looks like I need to add support for SD Card and Header (though most people have this one...) :)

    BTW, anyone can submit code updates, just push it and I'll approve... basically I am just rewriting the HacTool implementation in Python...
     
  12. TiMeBoMb4u2

    TiMeBoMb4u2 GBAtemp Maniac

    Member
    1,423
    397
    Oct 25, 2008
    United States
    I'm all for people improving upon tools—especially if you are writing from scratch. But if you plan to call hactool code, in any form, you may want to have a chat with @SciresM. I know he's not fond of people making GUIs or re-implementing his work (i.e. HACToolGUI)
     
  13. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Oh trust me, I know, I'm not utilizing his code, nor calling any of his code, I am just using hactool as a reference for making my own python version of a few of his methods...
     
  14. salamandrusker

    salamandrusker Advanced Member

    Newcomer
    55
    16
    Mar 12, 2018
    Spain
    share it when you have something
     
  15. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Updated the script!

    Now it does all of the generated keys (thus far) :)

    header_key
    sd_card_save_key
    sd_card_nca_key

    Next thing will probably be to allow people to import the file if they don't feel like re-entering the information after every push...
     
    salamandrusker and 8BitWonder like this.
  16. salamandrusker

    salamandrusker Advanced Member

    Newcomer
    55
    16
    Mar 12, 2018
    Spain
    go , nice job!
     
  17. ecumber

    ecumber Newbie

    Newcomer
    2
    0
    Jan 23, 2018
    United States
    Can this generate title keys?
     
  18. studio1b

    studio1b Advanced Member

    Newcomer
    74
    44
    Mar 14, 2009
    United States
    NEW YORK CITY
  19. SocraticBliss
    OP

    SocraticBliss Member

    Newcomer
    31
    30
    Jun 3, 2017
    United States
    Title keys are unique to each game, but they are in plaintext, you should be able to find them pretty easily...
     
Loading...