Einzelnen Beitrag anzeigen

greenmile

Registriert seit: 17. Apr 2003
1.107 Beiträge
 
Delphi 10.3 Rio
 
#1

Delphi PHP und Blowfish

  Alt 16. Mär 2015, 10:15
Hallo,

ich muss etwas in Delphi verschlüsseln und mit PHP wieder entschlüsseln. Hierfür nutze ich DEC 5.2, allerdings peile ich das nicht so recht. Vielleicht könnte mir jemand auf die Schnelle sagen warum folgendes nicht läuft? Das wäre super ... vielen Dank. Ich möchte einfach nur "quick and dirty" etwas auf die Schnelle halbwegs (!) sicher verschlüsseln.

Code:
function encryptBlowfisch(Key, Source: string): String;
  var IV: string;
begin
  IV := '12345678';
  with DECCipher.TCipher_Blowfish.Create do
   try
     Mode := cmCBCx;
     Init(Key,IV);
     Result := EncodeBinary(Source, TFormat_HEX);
   finally
     Free;
   end;
end;

function decryptBlowfisch(Key, Source: string): String;
  var IV: string;
begin
  IV := '12345678';
  with DECCipher.TCipher_Blowfish.Create do
   try
     Mode := cmCBCx;
     Init(Key,IV);
     Result := DecodeBinary(Source, TFormat_HEX);
   finally
     Free;
   end;
end;
Code:
 $decrypted_data = mcrypt_cfb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_ENCRYPT, '12345678');
  Mit Zitat antworten Zitat