SBORPS Random Fact 04
SCE media reports have always stated that the PSP has AES capabilities. These are apparently referring to the fact that the UMD format discs are AES encrypted. This means that SPOCK (the crypto engine responsible for UMD decryption) has AES decryption capabilities. KIRK on the other hand (the main crypto engine responsible for prx/eboot decryption) also has a block cipher but is unknown which algorithm it uses, though it is almost certainly AES as well. Currently what is known about the cipher is that it is:
- a block cipher operating in CBC mode
- an all zero 128-bit initialization vector
- 128-bit block and key sizes
- cmd4/7 uses a static key that is identical in all PSP’s
- cmd5/8 uses a key based off the fuseID making all operations unique per PSP
- cmd6/9 uses a user-defined 128-bit key
- cmd1/2/3 uses the block cipher but also signature algorithms
- the remaining KIRK cmd’s do not use the block cipher (sig, hash, & prng algo’s)
Interfacing with KIRK for general-purpose encryption is cumbersome and using a software-based lib is both slow and memory-consuming. Fortunately, there is another method: using the MagicGate hardware. The API provides both standard DES and AES algorithms.
- 0x2DAD213D sceMgrDESEncrypt
- 0xF5DFD97B sceMgrDESDecrypt
- 0x8A916574 sceMgrAESEncrypt
- 0x3054F8F1 sceMgrAESDecrypt
The prototypes are as follows:
-
/*
-
dst: output buffer
-
src: input buffer
-
size: input size
-
key: encryption/decryption key (64-bit for DES, 128-bit for AES)
-
iv: initialization vector for CBC mode (pass NULL for ECB mode) (64-bit for DES, 128-bit for AES)
-
*/
-
int sceMgrDESEncrypt(u8 *dst, u8 *src, int size, u8 *key, u8 *iv);
-
int sceMgrDESDecrypt(u8 *dst, u8 *src, int size, u8 *key, u8 *iv);
-
int sceMgrAESEncrypt(u8 *dst, u8 *src, int size, u8 *key, u8 *iv);
-
int sceMgrAESDecrypt(u8 *dst, u8 *src, int size, u8 *key, u8 *iv);
September 11th, 2008 at 10:36 am
when I see something about a 128-bit user-specified key, my mind instantly jumps to the savedata encryption
December 23rd, 2009 at 7:24 am
Sorry, i´m a noob, so could you please tell what´s that “u8″ or “u32″ for? I didn´t found any information (neither in Dev-forums nor Google).
January 31st, 2010 at 11:34 am
u8 = unsigned char
u32 = unsigned int
February 20th, 2010 at 10:43 am
Hi Sorry SilverSpring i have a question, how to use the functions in the mgr.prx (sceMgrAESEncrypt, etc…, etc..)