Ravi80335
(Ravi80335)
1
FString Word = "Hello";
FString newWord = FBase64::Encode(Word);
uint32 newWordSize = newWord.Len();
newWordSize = newWordSize + (FAES::AESBlockSize - (newWordSize % FAES::AESBlockSize));
uint8* newWordBytes = new uint8[newWordSize];
if (FBase64::Decode(*newWord, newWord.Len(), newWordBytes))
{
FString KeyStr = "JfryFIrdlovQALOPEXdsubnrUNBBbvVf";
ANSICHAR* AESKEY = TCHAR_TO_ANSI(*KeyStr);
FAES::EncryptData(newWordBytes, newWordSize, AESKEY);
FString EncryptedBase64Str = FBase64::Encode(newWordBytes, newWordSize); // uX32V+5lIDVhhVnr8UQt4g==
}
else
{
UE_LOG(LogTemp, Warning, TEXT("FBase64::Decode Failed"));
}
- decrypting this EncryptedBase64Str in ue4 will return Hello and Squared A symbol at end
i.e., something wrong with ending block
- check this EncryptedBase64Str with any online aes tool, decryption not working.
decryption not working in my nodejs webapi also, what’s wrong with it.
- NodeJS encrypted string decrypted in ue4 without any issues.