Skip to content

Add support to encrypted ISO#18498

Merged
AniLeo merged 1 commit into
RPCS3:masterfrom
digant73:add_encrypted_iso
Apr 10, 2026
Merged

Add support to encrypted ISO#18498
AniLeo merged 1 commit into
RPCS3:masterfrom
digant73:add_encrypted_iso

Conversation

@digant73
Copy link
Copy Markdown
Contributor

@digant73 digant73 commented Apr 2, 2026

NEW FEATURE

Follow up of #17996 adding support to encrypted ISO based on reference https://www.psx-place.com/threads/webman-mod-and-encrypted-iso.28667/.
The encrypted ISO (if any is detected) is decrypted on-the-fly during emulation.


Supported ISO encryption type:

  • Decrypted (.iso)
  • 3k3y (decrypted / encrypted) (.iso)
  • Redump (encrypted) (.iso + .dkey / .key)

Unsupported ISO encryption type:

  • Encrypted split ISO files

Encryption type detection:
The encryption type is selected according to the first matching encryption type found following the order below:

  • Redump type: ".dkey" or ".key" (as alternative) file, with the same name of the ".iso" file, exists in the same folder of the ".iso" file
  • 3k3y type: 3k3y watermark exists at offset 0xF70

NOTE: Both 3k3y and Redump types have been tested without performance drop compared to Decrypted ISO and Folder format


BUG FIXES

  • Fixed crash at boot (main window not even displayed) when parsing an ISO with an empty directory entry at file head

related #17996
reference https://www.psx-place.com/threads/webman-mod-and-encrypted-iso.28667/

@matheuswillder
Copy link
Copy Markdown

That's great news, I'll try to build and test it tonight if I have some free time.

Just a suggestion: couldn't the emulator also check for the .dkey files in a fallback location? For example, inside some folder in the emulator root folder?

Most games take up a lot of storage but the .dkey files are small enough to be backed up along with other emulator settings and files.

But of course, just a suggestion.

@AniLeo
Copy link
Copy Markdown
Member

AniLeo commented Apr 4, 2026

I agree, there should be a dkey directory at the root of rpcs3 where you can place your own keys

@digant73
Copy link
Copy Markdown
Contributor Author

digant73 commented Apr 4, 2026

that's an easy improvement I will consider on further PRs as also to implement #18185 etc.

Copy link
Copy Markdown
Contributor

@Megamouse Megamouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder that this is a c++ project, not a raw C project

Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.h Outdated
Comment thread rpcs3/Loader/ISO.h Outdated
Comment thread rpcs3/Loader/ISO.h Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
@digant73
Copy link
Copy Markdown
Contributor Author

digant73 commented Apr 4, 2026

Just a reminder that this is a c++ project, not a raw C project

applied the suggested changes with the exception of the two for which I provided a reply

Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.h
@Florin9doi
Copy link
Copy Markdown
Contributor

Are these 3k3y files still relevant?

@digant73
Copy link
Copy Markdown
Contributor Author

digant73 commented Apr 4, 2026

Are these 3k3y files still relevant?

I think so. it is a format where the key from .dkey is encapsulated on the ISO header

Comment thread rpcs3/Loader/ISO.cpp Outdated
Comment thread rpcs3/Loader/ISO.cpp Outdated
fix compile errors and suppress minor warnings

strip minor bug fixes and cleanup

minor cleanup

minor cleanup

Fixed crash at boot parsing an ISO with a empty directory entry at file head

applied suggested changes

added missing break in switch

Update rpcs3/Loader/ISO.cpp

Co-authored-by: Megamouse <studienricky89@googlemail.com>

use hex_to_bytes() instead of self made functions

minor cleanup

rewrite nested if()

add explicit support to .key

minor cleanup

optimize partial sector read

minor optimization

fix conflict
@digant73 digant73 force-pushed the add_encrypted_iso branch from 47afbaf to 641f954 Compare April 10, 2026 19:59
@AniLeo AniLeo merged commit 110c786 into RPCS3:master Apr 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants