1. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    This is my take, a Python implementation, of the Wii U title key generating algorithm that recently surfaced online.

    Source: https://github.com/dojafoja/Kii-U-Generator

    IF YOU RECEIVE AN ERROR ABOUT NO MODULE NAMED CRYPTO:
    Your Python setup doesn't include the pycrypto or pycryptodome library. You must first install one of these before you can use this tool, it is recommended that you install pycryptodome since it is still maintained:
    Code:
    python -m pip install pycryptodome
    Usage:
    First, open the ckey.json file and put the Wii U common key in here as plaintext. This is a json file so keep the structure as is.

    1: You can use the provided GUI by running gui.py. This should be straightforward to use.
    2: You can use as a CLI tool by running
    Code:
    keygen.py <title id> [password]
    Please note that the password argument is optional and will default to "mypass" which is correct for all games that I have tested so far. System titles, however, require a different password that I'm not sure of.
    3: You can include this into a Python script and use as a library. Please read the source code to see available functions

    What does this do? It can generate unencrypted AND encrypted title keys for the Wii U. It's a Python implementation of the PHP algorithm that recently surfaced. It's probably not very useful to most people but I had fun writing it and I learned a few new things so.... I wanted to share it! A big thank you goes to @V10lator for helping me with my snags along the way, mostly relating to the proper padding/unpadding of things. Thank you for being so nice and helping me understand these things!!
     
    Last edited by dojafoja, Sep 25, 2020
    Gunstorm, E1ite007, Ryccardo and 5 others like this.
  2. V10lator

    V10lator GBAtemp Fan
    Member

    Joined:
    Apr 21, 2019
    Messages:
    320
    Country:
    Germany
    Not sure about this but some pirate told me that some old system apps are encrypted with the password "test"... ;)
     
    Last edited by V10lator, Jun 7, 2020
  3. leon315

    leon315 POWERLIFTER
    Member

    Joined:
    Nov 27, 2013
    Messages:
    3,495
    Country:
    Italy
    what does this hb do? generates privaty key for online play?
     
    jeannotte likes this.
  4. V10lator

    V10lator GBAtemp Fan
    Member

    Joined:
    Apr 21, 2019
    Messages:
    320
    Country:
    Germany
    jeannotte likes this.
  5. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    No. It just generates title keys. Not very useful for most people but it eliminates the need for a title key database. I just had fun writing it and I like to share my work so....
     
    jeannotte likes this.
  6. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    When trying to launch either the GUI or CLI I keep getting an error (see screenshot) about a module named Crypto not found. Is there something I'm doing wrong?
     

    Attached Files:

  7. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    Hi there! It sucks that your Python setup doesn't come with the pycrypto library as standard. You must be on a Mac? I only test on Windows and various Linux distros. Most versions of Python come with this library already but Mac likes to complicate things. It should be an easy fix by installing pycrypto. https://pypi.org/project/pycrypto/

    Code:
    python -m pip install pycrypto
     
    Trishul likes this.
  8. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    I'm running into repeated errors about missing components (GMP or MPIR, basetsd.h, etc.) after several attempts to install this package. Do you know of Python installer that includes Pycrypto as standard? I'm running Windows 10 and picked up the basic installer from their main website and setup with default options. Thanks!
     

    Attached Files:

  9. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    It turns out that I'm wrong about a couple of things.
    Pycrypto might not be a standard library like I thought it was and is actually kind of deprecated. I wouldn't have used it if I knew that. I think I just so happen to have it installed on every single one of my python versions, except on Windows 10, which I apparently didn't test on because im having problems there too. I will work it out later after work, Thanks for bringing it to my attention.
     
    Trishul likes this.
  10. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    Actually I got this working fine with the current pycryptodome library. I tested it with some WUDs of retail only disc titles and it's not generating any accepted titlekeys trying all three of those known passwords. The title IDs I tried: 00050000-1010CF00, 00050000-1010E700, 00050000-10143200. Next I'll look into testing it on some more retail disc-only titles with known good titlekeys.
     
  11. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    Update: I tried these 3 other Disc-only Titles with known valid disc keys: 0005000010146800, 000500001010dc00, 0005000010134e00 and it turns out your app doesn't generate the same keys trying all 3 of those known passwords. I'm assuming there's only one valid key for each title.
     
  12. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    I'm not sure what you mean? I just tested it with 0005000010146800 and it generated the correct title key. I actually downloaded a dumped ticket for this title and extracted the title key myself and it matched the output of the generator.
     
  13. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    See the attached screenshot. Does the output jive with your result? All I know is it doesn't match the working Key I have for this title, which I tested by WUP installing on a console.
    As further test, can you PM me your Key output for these 2 disc-only titles I don't have proven keys for: 000500001010E700, 0005000010143200. I'll update you with the result. Thanks!
     
  14. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    You're gonna want to remove that screenshot because it contains a valid title key and yes that title key is correct. The only way it could be different is if it were packed up using NusPacker, in which case it would more than likely be encrypted with a different key
     
    Trishul likes this.
  15. Trishul

    Trishul Member
    Newcomer

    Joined:
    Sep 6, 2020
    Messages:
    13
    Country:
    United States
    Ok NusPacker must have been used with these titles, and I didn't know it generated a different key other than the disk key. Many thanks for enlightening me!
     
  16. dojafoja

    OP dojafoja life elevated
    Member

    Joined:
    Jan 2, 2014
    Messages:
    657
    Country:
    If NusPacker was used, it should have generated a title.tik file with the encrypted title key in it. NusPacker generates the same title key every time, unless you specify the -encryptionKey option when running it. It doesnt matter what key the contents were encrypted with as long as the encrypted key in the ticket gets decrypted and matches what the contents were encrypted with. I hope that makes sense....
     
    Last edited by dojafoja, Sep 26, 2020
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - [Release], Generator,