Mount encrypted pak file at runtime

I have created an encrypted pak file using unrealpak.exe
I am able to extract the contents using the key with unrealpak.

In my game I load content needed from a pak file on the fly, and all seems to be working well with unencrypted paks.

But I am not able to get the encrypted pak file to mount in the game at runtime. I can’t seem to figure out where it wants me to supply the aes key.

it crashes on the PakFile declaration line everytime, complaining of an invalid key

FPakFile PakFile(&PlatformFile, *PakFilename, false);

Can anyone show me where to supply the needed key to mount the pak file?

i tried added keys in various ini files. no go.
i tried added the public definition of AES_KEY in my projects build.cs file. nothing.
i tried the new crypto plugin, and added the key in project settings, no luck.
then i used a generated key from project settings to pak file, still won’t mount.
i looked into these IPlatformCrypto classes but could not seem to get an understanding enough to use them correctly or at all.
any thoughts out there would be much appreciated, thanks!

today I tried using the command line parameter of the FPakPlatformFile->Initialize method… I am not getting anywhere with this problem. I must be doing this very wrong.

for pak files not encrypted I was able to load with the following code:

    IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();
PakPlatformFile->Initialize(&PlatformFile, TEXT(""));
FPlatformFileManager::Get().SetPlatformFile(*PakPlatformFile);
const FString PakFilename = "F:/test48.pak";
FPakFile PakFile(&PlatformFile, *PakFilename, false);
const FString MountPoint(FPaths::EngineContentDir());
PakFile.SetMountPoint(*MountPoint);
if (PakPlatformFile->Mount(*PakFilename, 0, *MountPoint)){...}

Has anyone encrypted a pak file and mounted it at runtime?

moved to packaging and deployment in hopes of catching the eye of someone in the know :slight_smile:

moved to c++ for the real experts !
any thoughts would be most appreciated.

! stop talking to yourself! before you lose (the rest of) your mind!

seriously though, can ANYone give me ANY insight here?

bumping this… please help

Help! I need somebody!

Help! Not just anybody!
(actually, yes, anybody!)

Help! You know I need someone!

so much younger than today, I never needed anyone’s help in any way…

but now these days are gone I’m not so self-assured.
Now I find I’ve changed my mind, I’ve opened up the doors!

Help me if you can, I’m feeling down!

Also really curious about this. Nobody is doing this I guess…
PM me on the forums same name if you can

I went to the forums and sent you a mail last week, maybe we can figure this thing.

And I do appreciate you being 'round (anyone?)

Help me get my feet back on the ground!

Won’t you please, please help me?

I meet the same problem,are you solved??

I meet the same problem,are you solved??