Hello. I try to encrypt String.
This is my code.
FString teestclass::EncryptFString(FString OriginalFString)
{
FString EncryptedFString;
FString Key = "f";
if (OriginalFString.IsEmpty())
{
UDCLibrary::PrintErrorMessage(this, " : First Empty.");
return OriginalFString;
}
int32 Size = OriginalFString.Len();
TCHAR *String = OriginalFString.GetCharArray().GetData();
TCHAR *KeyString = Key.GetCharArray().GetData();
uint8* BytesString = (uint8*)TCHAR_TO_UTF8(String);
FAES::EncryptData(BytesString, Size);
TArray<uint8> EncryptedByteArray;
EncryptedByteArray.Append(BytesString, Size);
return FBase64::Encode(EncryptedByteArray);
}
[Projectname.target.cs]
public override void SetupGlobalEnvironment(
TargetInfo Target,
ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
)
{
OutCPPEnvironmentConfiguration.Definitions.Add("AES_KEY=f");
}
try1.
I used define key on target.cs. and full rebuild.
FAES::EncryptData(BytesString, Size);
This is result after debug my project.
Debug tool always indicate last line.
I think target.cs of AES_KEY is not working.
tyr2.
I used define key on code.
FAES::EncryptData(BytesString, Size, TCHAR_TO_ANSI(KeyString));
This is result after debug my project.
Debug tool always indicate last line.
why ifdef AES_KEY is here??.. .
I want to put AES_KEY in my project.
How Can I put this AES_KEY?..
Thank you for reading.