0

I have an old application written in Delphi XE5 using Lockbox 3. I'm upgrading the application to Delphi 11.1. Using the same Lockbox 3 source in Delphi 11.1, when sending the same string (in 11.1 and XE5) into DecryptSymStr, I get totally different results from Delphi XE5. Any ideas on what could cause this?

   cmdStr := 'JeITyQu7QhWMabJn9qc//lbcSGZqOkDmSBiPTDdNspSfnotu9v5ZfW40VfejWX2lm4wA0ODofvtT0zZ2YxFdZQ==';
         
  Secure3 := 
     DecryptSymStr(cmdStr);

In XE5, Secure3 = 'ACK', in D11 it is blank. I have tracked it to TSimpleCodec.DecryptString, the line L := Temp.Size; In D11, Temp.Size = 0, in XE5 it is 6.

Begin_DecryptMemory( Temp);
L := Ciphertext.Size; 
if L > 0 then
  DecryptMemory( Ciphertext.Memory^, L); 
End_DecryptMemory; 
if FisUserAborted then Plaintext := '' 
else 
begin 
  Temp.Position := 0; 
  L := Temp.Size;

Digging further into End_DecryptMemory in procedure TNoNonceDecryptor.End_Decrypt; In D11, Sentinal = $1CB01D9F, in XE5, Sentinal = $19B3023F. Is there a difference in PByte between XE5 and 11?

    Sentinal   := PByte( MemStrmOffset( FEmitBuffer, FBlockLen - 1));

oCodeRDL:   TCodec;

function DecryptSymStr(Value: ansistring): ansistring;
var
   tmpStr: ansistring;
begin
   GenRandomSymKey;
   if AllowEncryption then
   begin
      oCodeRDL.DecryptString(tmpStr, Value);
     Result := tmpStr;
   end
   else
      Result := Value;
end;

procedure GenRandomSymKey;
var
  mGuid: TGUID;
begin
   CreateGuid(mGuid);
   fPassPhrase := '{2F208563-D039-4CE0-9798-87F219674B5A}';
   oCodeRDL.Password := fPassPhrase;
end;

0 Answers0