TripleDES Encryption

Hi,

Please I need help with encrypting concatenated strings using TripleDES encryption
Example string “12345678”,hfbcjehce

==================
Sample Code

public function encryptPayload($data)
{
$key= $this->encKey;
$method = “des-ede3-cbc”;
$source = mb_convert_encoding($key, ‘UTF-16LE’, ‘UTF-8’);
$key = md5($source, true);
// $key .= substr($key, 0, 8);
$key .= substr($key, 0, 16);
$iv = “\0\0\0\0\0\0\0\0”; //Pad for PKCS7
$encData = openssl_encrypt($data,$method, $key, $options=OPENSSL_RAW_DATA, $iv);
return base64_encode($encData);
}

==============

I want pass the retuned $encData to a string

Sponsor our Newsletter | Privacy Policy | Terms of Service