Editing PSSE

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 4: Line 4:
PSSE stands for PlayStation Suite Encrypted. It is an encryption layer that encrypts the PSM game's filesystem.  
PSSE stands for PlayStation Suite Encrypted. It is an encryption layer that encrypts the PSM game's filesystem.  


The encryption layer is comparable to the PS Vita Protected [[Filesystem]] (PFS) in many ways; however, it seemed that there was a bug at Sony, where besides executable files, the first directory level of a PSM app is not encrypted with PSSE, whose directory level is below the root of RO/. Similarly, the PSM SaveData is not encrypted by such layer either.
The encryption layer is comparable to the PS Vita [[Filesystem]] in many ways; however, it seemed that there was a bug at Sony, where besides executable files, the first directory level of a PSM app is not encrypted with PSSE, whose directory level is below the root of RO/. Similarly, the PSM SaveData is not encrypted by such layer either.


== Data Structure ==
== Data Structure ==
{| class="wikitable" style="font-size:small; text-align: center;border;"
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
|-
|-
|'''offset'''  
| style="background-color:#FFFFFF; color:#123AAA;" |'''offset'''  
|'''value'''  
| style="background-color:#FFFFFF; color:#123AAA;" |'''value'''  
|'''description'''  
| style="background-color:#FFFFFF; color:#123AAA;" |'''description'''  
|-
|-
|0x00||0x50535345 (ASCII "PSSE" / "PSME")||Magic Number / File Header
|0x00||0x50535345 (ASCII "PSSE" / "PSME")||Magic Number / File Header
Line 17: Line 17:
|0x4|| int32 || Version  
|0x4|| int32 || Version  
|-
|-
|0x8 || int64 || Decrypted file size
|0x8 || int32 || Decrypted file size
|-
|0x10 || int32 || PSSE Type (always 0x1)
|-
|-
|0x14|| char[0x24] [[System_File_Object_(SFO)_(PSF)#CONTENT_ID|CONTENT_ID]]||Contents of /RW/System/content_id
|0x14|| char[0x24] [[System_File_Object_(SFO)_(PSF)#CONTENT_ID|CONTENT_ID]]||Contents of /RW/System/content_id
|-
|0x40|| char[0x10] || MD5 Of Original File (Plaintext)
|-
|0x50 || char[0x20] || Encrypted Filename
|-
|-
|0x70|| char[0x10] ||Encrypted IV
|0x70|| char[0x10] ||Encrypted IV
|-
|-
|0x80|| char[0x200] ||RSA Signature?
|0x680||Content Data|| Actural encrypted file data
|-
|0x280|| char[0x20] || HMAC hash of (encrypted) first block, (Vita), key is in RIF
|-
|0x2A0||char[0x1E0] || Reserved (all 0's)
|-
|0x480|| char[0x20] || HMAC hash of (encrypted) first block, (Android) key is in RIF
|-
|0x4A0|| char[0x1E0] || Reserved (all 0's)
|-
|0x680|| char[until next multiple of 0x8000] || encrypted block data
|-
|-
|}
|}
Line 47: Line 31:
AES-128-CBC decrypt 0x10 bytes from 0x70 using [[Keys#PSSE_Header_IV|PSSE Header IV]] and [[Keys#PSSE_Header_Key|PSSE Header Key]]
AES-128-CBC decrypt 0x10 bytes from 0x70 using [[Keys#PSSE_Header_IV|PSSE Header IV]] and [[Keys#PSSE_Header_Key|PSSE Header Key]]
the resulting decryption is the Contents IV, now take 0x10 bytes from 0x120 of the game's NoPsmDrm RIF, this is the Content Key
the resulting decryption is the Contents IV, now take 0x10 bytes from 0x120 of the game's NoPsmDrm RIF, this is the Content Key
(if its one of the DLL's in the PSM Runtime Package, then the content key is [[Keys#Runtime_PSSE_App_Key|Runtime PSSE App Key]])
(if its one of the DLL's in the PSM Runtime Package, then the content key is [[Keys#Runtime_PSSE_App_Key|Runtime PSSE App Key]]




Line 69: Line 53:


A script that implements the above algorithm can be found here:
A script that implements the above algorithm can be found here:
https://github.com/KuromeSan/psse-decrypt
https://github.com/KuromeSan/psse-decrypt/blob/master/decrypt.py
it is in the public domain, so feel free to use it for whatever you want
it is in the public domain, so feel free to use it for whatever you want
Please note that all contributions to Vita Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see Vita Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)