mycrypt 3des (php vs .net)
| From: | craig | Date: | Fri, 13 Feb 2004 16:26:01 +0000 |
| Subject: | mycrypt 3des (php vs .net) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177610@lists.php.net to get a copy of this message | ||
Hi all,
I am truly hoping that someone can help with this.
I am making the ecommerce site for a product that
I had nothing to do with the development of. =)
The product is making a licence file using the .net
3des, but I am not able to get the same output using
the mcrypt 3des.
this is the .net original text and the cipher text:
Golf Genie 5.0
ª:b#æa"6Û@Òt">#p0, 7
this is what i get
¿^U
ÎdÀ4oãõwÑî% - from Golf Genie 5.0
¿^U`ÎdÀ4!é$GIø - from Golf Genie 5.0\r\n
I don't know too much about encyrption, and I have found
the documentation of mcrypt to be the worst of any php
module I have yet used, so i'm not sure of the consequenses
of using cbc versus ecb are, etc.
here is the code i am using.
$key =
"\x6B\x00\x64\x00\x4E\x00\x44\x00\x38\x00\x37\x00\x5E\x00\x21\x00";
$input = "Golf Genie 5.0";
$iv = "\x2B\x00\x5F\x00\x65\x00\x6B\x00";
$td = mcrypt_module_open ('tripledes', '', 'cbc', '');
mcrypt_generic_init ($td, $key, $iv);
$encrypted_data = mcrypt_generic ($td, $input);
mcrypt_module_close ($td);
echo $encrypted_data;
ps. I can't use mcrypt_generic_deinit - i get 'Fatal error: Call to
undefined function: mcrypt_generic_deinit()... '
thanks in advance,
Craig