3DES in PHP is not same as Java
Started on: 24 December 12
I have a 3DES encrypted string from a service on java as -
30BA1A87B3B08F8A6F69BF0E2EC7539B when i am applying 3DES encryption in PHP to check the result, i am getting a very different string which is as -
ªã;Îù1ù@yq—ÿÃÓ"Õó[ûñüMƒº5fá$!Ø5JºÝ7 i am using an open source PHP lib for encryption, which is Crypt_TripleDES fromhttp://sourceforge.net/projects/phpseclib/.
Can someone help me, to understand what is wrong and where?
Please ask if I am missing anything.
Thanks
PHP Code -
require_once 'Crypt/TripleDES.php'; $tdes = new Crypt_TripleDES(); $tdes->setKey($key); $enc_text = $tdes->encrypt($text); echo 'Encrypted text - '.($enc_text).'
';
This challenge is listed under
Open Source
, Development & Implementations
, Data & Information Management
and Networks & IT Infrastructure
Community
Related Posts:
Please login to reply this post
Important:
- We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
- To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
- Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.