A simple class to encrypt and decrypt strings with a given salt (bijective).
composer require dandjo/simple-obfuscator
Instantiate the Obfuscator.
// create a new instance
$salt = 'my-security-by-obscurity';
$obfuscator = new \Dandjo\SimpleObfuscator\SimpleObfuscator($salt);
Then you can encrypt your string and decrypt the generated hex string.
$encrypted = $obfuscator->encrypt('4711-foobar'); // $encrypted == "6f927ea5a49b7c"
$decrypted = $obfuscator->decrypt('6f927ea5a49b7c'); // $decrypted === "4711-foobar"