Mcrypt function has been deprecated as of PHP 7.1.0.
My deprecated string encode / decode functions:
$key: secret key $str: string $encoded = base6
Consider using defuse or RNCryptor, they provide a complete solution, are being maintained and is correct.