Hi guys:
I have to send to a php script some sensitive data and I have to encrypt it, i
try DCPcrypt and madCrypt (I here that is working) but no one work, at last I
was not able to implement it.
here is my madCrypt code:
procedure TForm1.Button1Click(Sender: TObject);
var
data : AnsiString;
begin
data := memo1.Text;
madCrypt.Encrypt(data,'pass',12345678);
memo2.Text := encode(data);
end;
procedure TForm1.Button2Click(Sender: TObject);
var
data : AnsiString;
begin
data := decode(memo2.Text);
madCrypt.Decrypt(data,'pass',12345678);
memo3.Text := data;
end;
and here is my php script:
<?
function EncryptBlow($text)
{
$key = sha1("pass");
return
base64_encode(mcrypt_cbc(MCRYPT_BLOWFISH,$key,$text,MCRYPT_ENCRYPT,'12345678'));
}
function DecryptBlow($text)
{
$text = base64_decode($text);
$key = sha1("clau");
return
mcrypt_cbc(MCRYPT_BLOWFISH,$key,base64_decode($text),MCRYPT_DECRYPT,'12345678');
}
?>
I hope someone have a way to encrypt/decrypt data with both php and delphi.
Thank you,
Claudiu