Dear All,
After a lot of test, I have a problem with DCPCrypt Library from one machine encrypting in Delphi, to be decrypted in other machine using Lazarus
Same Library (DCPCrypt) same Hash and Same Cypher.
Here the Encrypt and Decrypt functions SAME at both programs (Delphi & Lazarus)
function TMod_Encripcion.Encrypt_String(KeyStr, Texto : String): string;
var
i: integer;
Cipher: TDCP_3des;
begin
if KeyStr <> '' then // get the passphrase
begin
Cipher:= TDCP_3des.Create(Self);
Cipher.InitStr(KeyStr,TDCP_sha256); // initialize the cipher with a hash of the passphrase
Result := Cipher.EncryptString(Texto);
Cipher.Burn;
Cipher.Free;
end;
end;
function TMod_Encripcion.Decrypt_String(KeyStr, Texto : String): string;
var
i: integer;
Cipher: TDCP_3des;
begin
if KeyStr <> '' then // get the passphrase
begin
Cipher:= TDCP_3des.Create(Self);
Cipher.InitStr(KeyStr,TDCP_sha256); // initialize the cipher with a hash of the passphrase
Result := Cipher.DecryptString(Texto);
Cipher.Burn;
Cipher.Free;
end;
end;
The result on the same machine Works perfectly, BUT if I take the Encrypted result on one machine, and try to decrypt on the other, the result is literally garbage.
Any thougths, & or help to makle this transportable, Will be appreciated.