Skip to content

Instantly share code, notes, and snippets.

@lesstif
Created May 6, 2021 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesstif/f589a4fba0ece69cce6ecc06acda023f to your computer and use it in GitHub Desktop.
Save lesstif/f589a4fba0ece69cce6ecc06acda023f to your computer and use it in GitHub Desktop.
<?php
$string = 'hello';
$en_str = phpseclib_mcrypt_encrypt(MCRYPT_3DES, $secretKey, $string, MCRYPT_MODE_ECB);
dump(bin2hex($en_str));
$de_str = phpseclib_mcrypt_decrypt(MCRYPT_3DES, $secretKey, $en_str, MCRYPT_MODE_ECB);
dump([$de_str => bin2hex($de_str)]);
dump(str_replace("\0", '', $de_str));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment