Post: Algorithm Reversal Based on Mathieulh's Decrypter
01-07-2011, 05:17 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Seeing that everyone has a serious need for FTP, I see it's time for my first post.

Edit: those of you helping, here you are...

You must login or register to view this content.

Before Anything, this thread is for the sole purpose of discussing the sign and encryption process (or algorithm) used on retail .pkg files and attempting to reverse the decryption process made by Mathieulh to sign HOMEBREW for use on KaKaRoToKs CFW v1.1 (or higher), namely OFW 3.55 functionality!

RESOURCES AT BOTTOM

There are definitely those of you interested in learning some sort of cryptography to sign ourselves some homebrew! With that, you might want to read up:

... just kidding, I'll give you guys a quick run-down! Since the PS3 uses asymmetric encryption under the Advanced Encryption Standard (AES), we needed both public keys and private keys used in specific algorithms to actually encrypt and decrypt files.

See You must login or register to view this content. For some extensive details!

Since we have the keys and algorithms for decryption, as provided by Mathieulh, it is possible to obtain an encryption algorithm (or better yet, an automated program to package, encrypt, and sign .pkg sets for us).

Those of you familiar with Visual C/C## will know what to do with Mathieulh's source included below.

For those who are new to it, just follow this quick guide:

1. Download the PSP_PS3_PKG_Decrypter
2. Head into the extractred directory.
3. Continue down the directories until you see this file: FormMain.cs
4. Open With Notepad...
5. And you're on your way! Check out the code, look at some of his comments, do whatever you think can help us get further!

Anyway, I don't fully understand the process used for encryption (or the entire decryption method, for that matter) and this thread should be a great basis for dev talk. Should we come across a functional algorithm, I'll do my best to create some sort of script that could at least make a proof-of-concept HelloWorld.pkg


As for what I know currently:

Decryption Process
-Concerning the case 0x01 (PS3 Decryption, not PSP):

1. Checks file length from address 0x1c of entire pkg for verification.
2. Checks file length from address 0x2c of encrypted file.
3. At address 0x70, the individual pkg key (encrypted) is stored (for later use in decryption, presumably).
4. A series of offsets and processing using public decryption keys stored in the Array are the resulting decrypted pkg (not yet unpacked). How this is done, I'm not entirely sure. The process is, as of yet, beyond me.
5. I haven't analyzed much farther... unpacking, I'm sure. I'll edit in or change according to findings. Outside info welcome! After all, what are forums for?

No way to have encryption without understanding all other aspects! Math concepts, really... single variable solving.

Other info: Both AES 256-bit and 128-bit keys are used (the erk and riv) when it comes down to the encryption process. The problem is how. Should you guys find anything, post away!

PS - I can be wrong, too. Correct me if you have reason. I only just started this little side project. Check out the Wiki below for some serious dev info. For that matter, hit up Lan.st!
Otherwise, I believe I have some decent information.Winky Winky




RESOURCES:
Mods don't want me to post Mathieulh's tool, so go find it yourself! -Google "ps3 pkg decrypter mathieulh"
You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 12 users say thank you to The Middle Man for this useful post:

Afrojack, benzy, demize, egonadrian, human193, oI xPozeD Io, Pillar2365, Sicarius, The-Don, xCamoLegend, xSkullz-, zackroman
01-07-2011, 08:12 AM #11
gola
OVER 9000!
Originally posted by hunter12 View Post
You cant just edit random pkgs and change a few bytes to allow you
to install unsigned packages, you need to patch the kernel. ( Thats what the jailbreak team patched by injecting a payload into the kernel.)

That said if you fuc.k one thing up in the kernel and trash lv2, theres
no unbricking it, end of. LV2DIAG.SELF needs lv2, aswell recovery menu (uses vsh.self). So all in all, its best to leave that to people who know what they are doing like KaKoRaTo, Mathieulh etc.

Im not trying to be an ass to you if you take it that way, im just warning you that messing with the dev_flash is NOT a safe thing to do.

Mhm.. I know the risks and all, it being worse than bricked literally being forever useless with modding the kernel you only have 1 chance etc.. I've got kakaroto on AIM he answers some stuff but is definitely against piracy (or atleast says so so he can't break any laws Cool Man (aka Tustin) )....

p.s. the ps3 i use for it is buggy and slow as crap anyways xD
01-07-2011, 08:14 AM #12
Dylan_Owns
Master of teh internetz
Originally posted by Broseidon View Post
I don't see why everyone tries modding the .pkgs themself and not the firmware, thats what I'm working on, all you have to do is change it to run un-signed .pkgs lmfao, much MUCH easier. Either way whichever one you do is illegal so it hardly matters, due to modding the firmware to run un-official files by making them the equivelant of official and running un-signed files on a PS3.

So far I've bricked my 3.41 CFW PS3 2 times just trying out random stuff, just keep un-bricking it using the tut zonetw0 posted haha.

P.S. There are tools out there to extract the firmware .PUP, just go on kakarotos' GITHUB.


Signing packages isn't illegal. Illegal hacking is when it circumvents or interferes with the Digital Rights Management, and usually obtaining the keyfiles does not.
01-07-2011, 08:16 AM #13
ballakid77
Gym leader
Originally posted by skylerleighty View Post
This is EXACTLY whati was talking about in my other post and in the sb

Sucks that i don't know C#, or i'd have it reversed and the ftp signed


Haha okay so I got linux now I just need to work on the stuff, I have another final tomorrow so for sure after school u can bet I am going straight home and working on this stuff, as for C#, u can bet I will be working my a$$ off learning atleast the basics especially since this is what I will be majoring in college, it's my senior year right now haha whoo class of 2011!!! Dylan_owns is on my skype, do u hav a skype as well? perhaps we can probably worktogether and try different methods and chat through there tomorrow to maybe help each other get this done haha
01-07-2011, 08:16 AM #14
gola
OVER 9000!
Originally posted by Owns View Post
Signing packages isn't illegal. Illegal hacking is when it circumvents or interferes with the Digital Rights Management, and usually obtaining the keyfiles does not.


I'm sure its illegal to an extent... depends what you plan/ do use it for really. Never read the DRM, link me? Thanks in advance.
01-07-2011, 08:18 AM #15
hunter12
Retired, done with gaming
Originally posted by Broseidon View Post
Mhm.. I know the risks and all, it being worse than bricked literally being forever useless with modding the kernel you only have 1 chance etc.. I've got kakaroto on AIM he answers some stuff but is definitely against piracy (or atleast says so so he can't break any laws Cool Man (aka Tustin) )....

p.s. the ps3 i use for it is buggy and slow as crap anyways xD


Ah thats good, KaKoRaTo is probably the nicest dude out there
He deserves more recognition for his work lol
( hes the dude that made PL3, best JB payload incase others didnt no ) xD

Also usbfirmloader is a good homebrew to mount your firmware
no need to wait 4 hours for your ps3 to flash, simply mount test
your firmware, then your done. : D
01-07-2011, 08:21 AM #16
Dylan_Owns
Master of teh internetz
Originally posted by Broseidon View Post
I'm sure its illegal to an extent... depends what you plan/ do use it for really. Never read the DRM, link me? Thanks in advance.


You must login or register to view this content.

Article about DRM in general

The following user thanked Dylan_Owns for this useful post:

gola
01-07-2011, 08:37 AM #17
ZoneTw0
You talkin to me?
. .
01-07-2011, 09:02 AM #18
Mathieulh said the pkgs aren't even signed, just encrypted.
01-07-2011, 12:25 PM #19
vettacossx
Bounty hunter
id keep an eye out for hermes and crew as well as waninkoko and the other overly blackhat piracy loving developers on You must login or register to view this content. and the other spanish devs sites they were first to get the job done for pirates last time and for homebrewers :pirate:Outie

The following user thanked vettacossx for this useful post:

NeglectFate

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo