PS3 libSceSecure

dittnamn

Member
I've been looking into the Singstar DLC encryption in another thread, and noticed an external library being used called libSceSecure.sprx. I can't really find any information about this, so I'm wondering if anyone here could tell me what it does.

All I could find is that a PS4 version exists, called libSceSecure.prx. That one seems to have been included with some PS4 homebrew and Gran Turismo Sport. I also found a pastebin with a file list from some API (possibly internal) that included some files related to it.

What I would like to know is, what it does and if it could help me decrypt/encrypt my files? Is there any API/documentation available for it, or has anyone managed to access the functions in it in some other way?
 
the library basically implements regular hashing and encryption methods. From some readme.txt notes:

Code:
<Project Name>
 
    libsecure version 2.0.0

<Description of Library>

    The Secure Library provides functionality to encrypt and to decrypt
    messages with different ciphers (TEA, XTEA, BlowFish, RSA, AES).
    It also gives the possibility to authenticate messages to ensure a
    message has not been tampered with (MD5, SHA1, SHA256, SHA384, SHA512).
    This library also gives the ability to developers to use additional
    ciphers and hash methods, or implement new ones.

the library was part of the official SDK, and it has documentation and samples, but of course such files won't be found here.

Maybe @DeViL303 has some additional details as he was looking into the PSHome encryption recently.
 
Alright, that sounds like it could be the one I'm looking for. I noticed it's called libsecure though instead of libSceSecure. Is that the normal naming convention, or could there be some other library as well?

@DeViL303 : Information about the PSHome encryption might absolutely be of interest. The normal encryptions used on the PS3 (AES, etc.) didn't really fit into the picture due to irregular file sizes. Were there any key files used, and how did you extract the keys? I have extracted a keys.edat file, but can't really figure out which part of the file that is the key.
 
I did find some documentation about the library now and it was just different names for the same library. I noticed that it had support for ciphertext stealing etc. as padding, so that might explain the filesizes. Many of the encrypted files have odd filesizes that are not divisible by a normal block size (or even by 2) so I've just thought that it was a stream cipher.

Which cipher and padding would be most likely to be used and what would be the most likely key length? Has there been any similar cases to this:
  • The encrypted file sizes are most likely the same as the decrypted. There have been some differences between systems, but I suspect that this has to do with different versions of the files. The files that have differed have had between a few bytes and around 200 kB difference.
  • Some of the files have a 256 byte footer that's encrypted separately.
  • Some of the files have a 256 byte difference in the reported sizes in an XML file compared to the actual file size.
  • The entire files seems to be encrypted. I can't see any traces that the incomplete blocks would be unencrypted.
  • The extracted keyfile is 1536 bytes, and I suspect that the key length is 256 bytes, due to the file structure which is:
    Code:
    - 8 bytes header?
    - 248 bytes repeating information in 16 bytes blocks.
    - 256 bytes random looking information (possible key #1).
    - 8 bytes with same header as before.
    - 248 bytes with the same repeating information as before.
    - 256 bytes random looking information (possible key #2).
    - 8 bytes with the same header as before.
    - 248 bytes with the same repeating information as before.
    - 256 bytes random looking information (possible key #3).
I guess this would mean RSA-2048, but it seems unconventional to use that without padding, ciphertext stealing, etc. Has this been used in any other part of the PS3?

I couldn't really find any tool available that allowed me to test this out either, so if anyone has any ideas that doesn't involve creating an application using the API that would be helpful.
 

Similar threads

Back
Top