Sealedkey / pfsSKKey: Difference between revisions

From Vita Developer wiki
Jump to navigation Jump to search
(Created page with "=== File Structure === {| class="wikitable" |- ! Offset !! Size !! Description |- | 0x0 || 0x8 || magic "pfsSKKey" |- | 0x8 || 0x4 || Type (always 2) |- | 0xC || 0x4 || 00 Fi...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== File Structure ===
sealedkey file is located in sce_sys folder of savedata/trophies. It is not PFS encrypted.
 
It is used as a per savedata/trophy key in PFS encryption/decryption whilst gamedata/addcont uses klicensee.
 
== File Structure ==


{| class="wikitable"
{| class="wikitable"
|-
! Offset !! Size !! Description
! Offset !! Size !! Description
|-
|-
| 0x0 || 0x8 || magic "pfsSKKey"
| 0x0 || 0x8 || Magic "pfsSKKey"
|-
|-
| 0x8 || 0x4 || Type (always 2)
| 0x8 || 0x4 || Type (always 2)
|-
|-
| 0xC || 0x4 || 00 Filler
| 0xC || 0x4 || Padding / unk
|-
|-
| 0x10 || 0x10 || IV for encrypted key
| 0x10 || 0x10 || IV for encrypted key
Line 16: Line 19:
|-
|-
| 0x30 || 0x20 || HMAC Value
| 0x30 || 0x20 || HMAC Value
|-
|}
|}
== Decryption ==


The first step is to check the HMAC of the file. The process is to use the HMAC key from the [[Keys#PFS_Secret_Keys]] page to check the HMAC at position 0x30 in the file. If it is correct, it proceeds to use the pfsSKKey_EncKey to decrypt the value at +0x20 using the value at +0x10 as the IV.
The first step is to check the HMAC of the file. The process is to use the HMAC key from the [[Keys#PFS_Secret_Keys]] page to check the HMAC at position 0x30 in the file. If it is correct, it proceeds to use the pfsSKKey_EncKey to decrypt the value at +0x20 using the value at +0x10 as the IV.

Latest revision as of 20:57, 26 April 2018

sealedkey file is located in sce_sys folder of savedata/trophies. It is not PFS encrypted.

It is used as a per savedata/trophy key in PFS encryption/decryption whilst gamedata/addcont uses klicensee.

File Structure[edit | edit source]

Offset Size Description
0x0 0x8 Magic "pfsSKKey"
0x8 0x4 Type (always 2)
0xC 0x4 Padding / unk
0x10 0x10 IV for encrypted key
0x20 0x10 Encrypted key
0x30 0x20 HMAC Value

Decryption[edit | edit source]

The first step is to check the HMAC of the file. The process is to use the HMAC key from the Keys#PFS_Secret_Keys page to check the HMAC at position 0x30 in the file. If it is correct, it proceeds to use the pfsSKKey_EncKey to decrypt the value at +0x20 using the value at +0x10 as the IV.