Jump to content

PHP 3DES ENCRYPTION RESULT


harsus

Recommended Posts

Good day all, I need some help with a piece of code I wrote.

I have a 16 digit hex value whic I encrypt (3DES) with another 16 digit hex value. The result is a 32 digit hex value. The problem is I need to store the result in a 16 digit hex value to transport it to a host which will do the decryption.

 

$data = "3e5fa17b6ab1b1b1";

$key  = "0123456789abcdef";

$enc = mcrypt_cbc (mcrypt_3des, $key, $data, mcrypt_encrypt);  --> this results in 16 position raw binary data

$enc = bin2hex($enc);  --> I get a 32 digit hex value, but the space available will only fit a 16 digit hex value.

 

If i'm going about this totally wrong please let me know, this has been buggin me for some time now.

Any help would be grately appreciated.

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/232324-php-3des-encryption-result/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.