Both FAES::DecryptData and FAES::EncryptData functions are behaving in the same way. Both of them are encrypting data and giving exactly the same outputs from same inputs. I can’t decrypt encrypted data.
Look at the codes. Note that “Reverse” boolean activates decryption mode.
Your project needs to have AES_KEY macro defined in order to be able to encrypt anything with AES. We do not define in on purpose because otherwise anyone who has access to UE4 source code would be able to decrypt your data. Have a look at AES.cpp. The macro should be either hardcoded in source code or defined in your target.cs files.
Hi,
I debated opening a new question but my query is relevant to this answer thread post (and this post comes up when searching google).
I’m somewhat lacking in a lot of c++ knowledge, so please could you tell me how you define the AES_KEY macro in the target.cs file as I couldn’t find any answer in my searches.
Also, I’ll admit to being a bit confused, does AES_KEY only work if the engine is built from source and modified or can it be defined in a standard C++ project target.cs file without any engine source code modifications (which is what I’m hoping for)?
You should be able to define the key you want to use for encryption by adding Definitions.Add(“AES_KEY=[SpecificKey]”); to the ProjectName.Build.cs file and then regenerate project solution files. This should work for a binary project from the launcher without source modifications.
They still can and the method is exactly the same as if you defined it yourself: you find a function that takes this AES key to encrypt or decrypt and then you see how it gets called, and you most probably get a static and not encrypted C-style string embedded in the executable. Or if they encrypt that, you attach a debugger and get the raw C-style string at runtime.
Why even bother, it feels like it was a waste of time to implement this feature. Unless it’s just for managers, so they can tell other managers that Unreal Engine protects its’ data assets with AES-256 encryption