Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Stranger of Paradise: Final Fantasy Origin - SRST files

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

i need help with this description because i'm confused with the explanation :

"To determine whether a file is encrypted, the game checks offset 0x20 in the KTSR header which immediately follows the 0x10 byte SRST header. The encryption algorithm is Blowfish in ECB mode."

"The byte value stored in that offset is the encryption key length, with the key itself following from the next byte - if the value is 0, no decryption is performed."

my question within this file is, what is the encryption key? thanks~
You do not have the required permissions to view the files attached to this post.
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Need help with Encryption of a game file..

Post by ikskoks »

What is name of the game this file comes from?
What is the platform? PC? XBOX?

Also please attach some samples.
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Need help with Encryption of a game file..

Post by mamekoski »

ikskoks wrote: Tue Dec 27, 2022 12:56 pm What is name of the game this file comes from?
What is the platform? PC? XBOX?

Also please attach some samples.
it's a decrypted audio file(s) from SOPFFO PC which need to be re-encrypted to be played in-game. i couldn't attach a sample because that SRST file is over 500MBs..

i just need to know what is the encryption key based on my screenshot above.
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by ikskoks »

i couldn't attach a sample because that SRST file is over 500MBs..
You can upload it to some hosting site like mega.nz, google drive etc. and then share a public link here.
i just need to know what is the encryption key based on my screenshot above.
That's NOT how reverse engineering works :D
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

ikskoks wrote: Tue Dec 27, 2022 9:14 pm That's NOT how reverse engineering works :D
sorry i haven't explained before. the description i provide above is from the decryptor's github & that's what he/she provide regarding how to re-encrypt the file. since the repo has been archived, i can't comment to reply & github doesn't have private message feature.

that's why i'm asking here, so i could understand which part of the Hex is the encryption key from the decryptor's phrase: "The byte value stored in that offset is the encryption key length, with the key itself following from the next byte - if the value is 0, no decryption is performed."
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by ikskoks »

Ok, thanks for explanation. Can you send a link to this archived github repositroy?
I can't find it anywhere.

EDIT: Btw, according to the logic described by you in the first post, key length is 7 and key is "77 45 D6 E5 64 13 ED" (as hex).
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

here's the link i've been forwarded when i asked some people in P5S modding discord regarding SOPFFO archive modding, since both utilize same format & i successfully mod weapon textures in SOPFFO (but haven't got more insight with BGMs).

https://github.com/yretenai/Cethleann/pull/36

btw, should i use openssl or quickbms to execute Blowfish ECB encryption? thanks a bunch~
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by ikskoks »

btw, should i use openssl or quickbms to execute Blowfish ECB encryption?
You can use quickbms (+ reimport mode)
More info here http://aluigi.altervista.org/papers/quickbms.txt

This should be something like this in the script:

Code: Select all

encryption bf_ecb "\x77\x45\xD6\xE5\x64\x13\xED"
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

hello @ikskoks , sorry for the hiatus (have been busy with work). i've successfully encrypt all individual audio files, but i get a bit problem regarding how do i repack these audio files into a KTSR package before putting it into SRST file.

i provide the original KTSR file as reference, and marked the starting lines of the 1st encrypted audio.
.
d66ce491 ktsr.png
You do not have the required permissions to view the files attached to this post.
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by ikskoks »

Quickbms has reimport mode (I've already mentioned it earlier).
You can import files back with the same script that was used for export.
mamekoski
n00b
Posts: 13
Joined: Tue Jul 31, 2012 7:03 pm
Been thanked: 2 times

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by mamekoski »

ikskoks wrote: Sat Jan 21, 2023 8:28 pm Quickbms has reimport mode (I've already mentioned it earlier).
You can import files back with the same script that was used for export.
actually, i can't because i extracted those audios from this program https://github.com/yretenai/Cethleann/pull/36
i understand the reimport mode, but the script you provided only encrypted back each decrypted audio, so i'm a bit lost regarding to repackage them into KTSR.
User avatar
ikskoks
Moderator
Posts: 1667
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: Stranger of Paradise: Final Fantasy Origin - SRST files

Post by ikskoks »

I'm not an expert on Koei Tecmo formats, but I think that if encryption method is known and Cethleann source code is public, it should be possible to rewrite it's code as quickbms script (at least small part of it) and then use the same script for reimport.

But first, someone needs to write such script and make it public. :D
Post Reply