Is Encryption/Decryption ready to use In UE4

Hi Dear Community,

I’m using UE4.2. I need use encryption/decryption in my project and I try to use FAES::EncryptData and FAES::DecryptData. But when I use them I got an error:

*error LNK2019: unresolved external symbol “public: static void __cdecl FAES::EncryptData(unsigned char *,unsigned int,char *)” (?EncryptData@FAES@@SAXPEAEIPEAD@Z) referenced in function "public: static bool __cdecl UGameplayStaticsEx::SaveGameToSlotWithEncryption(class USaveGame ,class FString const &,int)" (?SaveGameToSlotWithEncryption@UGameplayStaticsEx@@SA_NPEAVUSaveGame@@AEBVFString@@H@Z)

So I guess it is not ready to use, and not included in the core.dll ( the installed version of unreal engine4.2) ?

That’s a pretty standard linker error. I suspect you’re getting it because it has the wrong signature. Searching my local codebase gives me these definitions, though I am on a slightly older version:

static void EncryptData( uint8 *Contents, uint32 FileSize );
static void DecryptData( uint8 *Contents, uint32 FileSize );

Thanks. In the AES.h File, there are four function defined:

static void EncryptData( uint8 *Contents, uint32 NumBytes );

static void DecryptData( uint8 *Contents, uint32 NumBytes );

static void EncryptData(uint8* Contents, uint32 NumBytes, ANSICHAR* Key);

static void DecryptData(uint8* Contents, uint32 NumBytes, ANSICHAR* Key);

I chose to use the last two and I get this error. Actually the first two use a predefined key to make a call of the last two inside their function body respectively. I will try the first two to see whether it works, really doubt that.

I have tried them, get the same error

Then I’d hazard a guess the relevant file isn’t being included in your project.

I did.
In MyGame.build.cs:
PublicDependencyModuleNames.Add(“Core”);

In the cpp file where I use them:
#include “Misc/AES.h”

Could you try to use them in your project and to see how it works, thanks a lot. If I can’t use it,then I need use third party library like CryptoPP, which I’m trying to use with in my game project.