Misc Project [URGENT] C# CIA Decryption

ndsboy87

Member
OP
Newcomer
Joined
Dec 2, 2023
Messages
16
Trophies
0
XP
41
Country
United States
I'm planning to release 3DSPal 2.0 ASAP, but need help, this is my second post I just didn't tag/word the other one correctly.

I am the developer for 3DSPal, and I also own 3DSTools organization on GitHub. I need to decrypt CIA's when a user downloads one via C#, but the problem is I have no knowledge about the decryption of CIA's and I definitely don't want to go from CIA Downloader to 3DS Downloader because that would be down-right useless. Let me know if you know how to/or have a C# script to decrypt CIA's. The reason I need this ASAP is because I'm upgrading CIA servers from http://streetpass.ct8.pl/port/ to https://3ds.bopdev.org/ (I would make a new domain for my 3DSTools thing but I just got scammed by namecheap when they told me my domain "3.ds" would be visible to everyone but apparently it was a handshake domain.)

3DSTools: https://github.com/3DSTools
3DSPal: https://github.com/3DSTools/3DSPal
My Github: https://github.com/ndsboy87
Contact Info - Discord: ndsboy87
 

anotherthing

Well-Known Member
Member
Joined
Mar 30, 2023
Messages
250
Trophies
0
Age
52
XP
344
Country
United States
I'm kind of fuzzy on what you're trying to do. However, before you answer in any detail, I have no idea how the CIA file format works nor do I know anything about C# other than it was MicroSoft's attempt to kill off Java. But I am curious as to what you're trying to do and the long term purpose of the 3DSPal.
 

ndsboy87

Member
OP
Newcomer
Joined
Dec 2, 2023
Messages
16
Trophies
0
XP
41
Country
United States
I'm kind of fuzzy on what you're trying to do. However, before you answer in any detail, I have no idea how the CIA file format works nor do I know anything about C# other than it was MicroSoft's attempt to kill off Java. But I am curious as to what you're trying to do and the long term purpose of the 3DSPal.
Real Nintendo CIA's (from the eShop) are encrypted, so to load it up to your 3DS normally, you need to decrypt the CIA file, using FBI or hsh (hShop) now what I'm trying to do is decrypt it in C# and already place it into your games, also when you decrypt it instead of ".cia" it becomes ".3ds" I can already do this for 3DS development software *which I'm working on Toolbox, 3DSPal's CIA Downloader but on the 3DS*
 

lone_wolf323

Well-Known Member
Member
Joined
May 27, 2011
Messages
5,514
Trophies
2
XP
4,992
Country
Canada
Real Nintendo CIA's (from the eShop) are encrypted, so to load it up to your 3DS normally, you need to decrypt the CIA file, using FBI or hsh (hShop) now what I'm trying to do is decrypt it in C# and already place it into your games, also when you decrypt it instead of ".cia" it becomes ".3ds" I can already do this for 3DS development software *which I'm working on Toolbox, 3DSPal's CIA Downloader but on the 3DS*
Are you sure you understand the 3ds console correctly? Why exactly would we need to decrypt the .cia files when FBI uses them without problems to install the games they are for?
 

ndsboy87

Member
OP
Newcomer
Joined
Dec 2, 2023
Messages
16
Trophies
0
XP
41
Country
United States
I'm also curious why you're using C# as opposed to C/C++ when DevKitPro is C/C++.
This is an EXE, so I'm using C#, It downloads CIA's to the "cias" folder so you can decrypt the CIAs with a 3ds homebrew app of your choice.
Post automatically merged:

I'm also curious why you're using C# as opposed to C/C++ when DevKitPro is C/C++.
Oh and, the other post was for my homebrew app.
 

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
139
Trophies
0
XP
2,241
Country
Russia
Eshop content have AES Cipher Block Chaining (CBC) encrypt (Need Decrypt Ttitlekey) + AES Counter mode (CTR) encrypt + CryptoSeed. .I have a script for python3 for full decrypt .cia and .3ds
 
  • Like
Reactions: anotherthing

ndsboy87

Member
OP
Newcomer
Joined
Dec 2, 2023
Messages
16
Trophies
0
XP
41
Country
United States
Eshop content have AES Cipher Block Chaining (CBC) encrypt (Need Decrypt Ttitlekey) + AES Counter mode (CTR) encrypt + CryptoSeed. .I have a script for python3 for full decrypt .cia and .3ds
I believe you can run python code with arguments in C#, but how does your program work?
 

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
139
Trophies
0
XP
2,241
Country
Russia
Python version need install with pycryptodome package
CIA encrypt (eshop) ---> CIA decrypt
3DS encrypt (cartridge)---> 3DS decrypt
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,744
Trophies
2
XP
8,592
Country
Tuvalu
I believe you can run python code with arguments in C#, but how does your program work?
If you want to do this properly you will port / implement it in C#, and not just call python code from your application.
Take a look at botik's implementation if and when you can, or here's something I found in just a few minutes via searching online
https://github.com/shijimasoft/cia-unix/blob/main/decrypt.py
At least you won't have to start from scratch! Good luck
Post automatically merged:

I think ihaveamac(?) made a tool that can take a cia / 3ds contents and place it on the sd card, encrypted to the specific console. Are you trying to do something like that?
 
Last edited by cearp,

ndsboy87

Member
OP
Newcomer
Joined
Dec 2, 2023
Messages
16
Trophies
0
XP
41
Country
United States
If you want to do this properly you will port / implement it in C#, and not just call python code from your application.
Take a look at botik's implementation if and when you can, or here's something I found in just a few minutes via searching online
https://github.com/shijimasoft/cia-unix/blob/main/decrypt.py
At least you won't have to start from scratch! Good luck
Post automatically merged:

I think ihaveamac(?) made a tool that can take a cia / 3ds contents and place it on the sd card, encrypted to the specific console. Are you trying to do something like that?
YES, EXACTLY! If your talking about directly placing the titles so on boot it will be there, yes thats exactly what I need!
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,473
Country
Canada
This is an EXE, so I'm using C#
Surely you realize you can make a .exe with Python or pretty much any other programming language..?

YES, EXACTLY! If your talking about directly placing the titles so on boot it will be there, yes thats exactly what I need!
There's no such thing. If you're thinking of something like custom-install, then even after you copy the encrypted data to the card, you still need to run faketik (or "custom-install-finalize"). It won't be there "on boot".
 
Last edited by Kwyjor,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, may I see it?
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, I sometimes check out /vg/ to look for any good retro gaming recommendations.
    +1
  • SylverReZ @ SylverReZ:
    The PS2 was quite a good console for its time. Imagine how many people in Spain are still using one LOL.
  • K3Nv2 @ K3Nv2:
    Today's technology makes anything from last gen look like shit
    +2
  • SylverReZ @ SylverReZ:
    @K3Nv2, Exactly. Take note of the Switch, for example. Its underpowered compared to how older tech was capable of doing just about anything.
  • K3Nv2 @ K3Nv2:
    Wii u was shit fight me
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, 1) I never entered 4chan 2) I have good memories with my PS2 even though most of the games i had were scratched beyond being bootable
    +1
  • SylverReZ @ SylverReZ:
    @K3Nv2, Not gonna lie, about half of its game library was shovelware like its counterpart, the Wii.
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, and the other half were just 1st party games
    +1
  • SylverReZ @ SylverReZ:
    @Xdqwerty, The Wii U was essentially an early Switch, before the Switch was a thing.
  • K3Nv2 @ K3Nv2:
    They already had the technology but the price to performance wasn't there
    +2
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, and before third party companies were able to make games for the newest nintendo console
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Older systems I love some of the games but without filters and enhanced graphics they are difficult to enjoy
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    Especially the PS1....
  • Psionic Roshambo @ Psionic Roshambo:
    That thing needs all the bandaids lol
  • Psionic Roshambo @ Psionic Roshambo:
    I think my favorite PS1 enhancement is sub pixel precision, helps get rid of some of those wobbly polygons lol
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, By default, the polygons are filtered with differing to simulate depth, which doesn't make them clearer.
    +1
  • K3Nv2 @ K3Nv2:
    Which GPU was hot in the ps1 era psi besides all of them
    +1
  • SylverReZ @ SylverReZ:
    There are ways to disable this by creating cheat codes, but this requires knowledge of the PS1 hardware.
  • K3Nv2 @ K3Nv2:
    I miss the old game shark books you could just go to Walmart and buy now it's instant ban or some punishefor using cheats
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I have physical copies of both Pokémon diamond and Pokémon black, gonna post them on my profile
    +1
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, the filters i hate the most are the bilinear ones
  • Psionic Roshambo @ Psionic Roshambo:
    @K3Nv2, when the PS1 was out I had the PS1 the N64 and on PC I had the Voodoo 2 and glide looked soooo nice at the time 🥰
  • Psionic Roshambo @ Psionic Roshambo:
    Biliniar filters are OK but brz is better I like SuperEagle but out of all of them xbrz is probably the most computationaly expensive
    Psionic Roshambo @ Psionic Roshambo: Biliniar filters are OK but brz is better I like SuperEagle but out of all of them xbrz is...