Last active
November 4, 2015 13:26
-
-
Save jordic/331c68915b41e931824e to your computer and use it in GitHub Desktop.
3DES_crypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#$key = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7'; | |
#$order = '12345'; | |
$key = $argv[1]; | |
$order = $argv[2]; | |
$bytes = array(0,0,0,0,0,0,0,0); | |
$iv = implode(array_map("chr", $bytes)); | |
$ct = mcrypt_encrypt(MCRYPT_3DES, base64_decode($key), $order, MCRYPT_MODE_CBC, $iv); | |
#echo $ct . '\n'; | |
echo "Base 64 encoded key:\n"; | |
echo base64_encode($ct); | |
echo "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5.6-cli | |
RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
&& docker-php-ext-install mcrypt | |
CMD ["php"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment