i am using ccbill and making upgrade system . In that i need to pass the username or user id plus the key in TripleDES encrypted string, Base64 Encoded format . I know we can use base64_encode
for base64 encoding . But how to achieve the requirements they want the value to be in ?
Asked
Active
Viewed 654 times
0

user1001176
- 1,156
- 3
- 15
- 36
-
Don't they have some sort of demo for implementation that covers this? Check out their API documentation. – Jonathan Kuhn Feb 18 '15 at 20:15
1 Answers
1
The first example from the mcrypt page in the PHP documentation has TripleDES for you http://php.net/manual/en/mcrypt.examples.php
<?php
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
$base64encodedafter3des=base64_encode($encrypted_data);
?>
Also looks like someone has answered this question in perfect detail already. Here is a link to his answer. You want the post by @Eric Kigathi about ccbill https://stackoverflow.com/a/11925394/4179009

Community
- 1
- 1

greg_diesel
- 2,955
- 1
- 15
- 24
-
Thank you for your reply so i would need to encode this to base64 later or not ? and what is the secret key here ? – user1001176 Feb 18 '15 at 20:15
-
-
-
Greg you saved my life . LOL . Thank you so much for linking the post – user1001176 Feb 18 '15 at 20:32