I want to encrypt a URL variable so that the user can't see the information when it is passed. I've found several scripts online but none of them work. Most seem to lean toward using base-64. Could someone help me write a short script that would encode or encrypt and then reverse that in the next page? It doesn't have to be super secure, just enough to mask an email address to the average user.
Obscure and encode a URL parameter
5.5k Views Asked by sehummel At
2
There are 2 best solutions below
0

You can use a symmetric encryption algorithm. You can use mcrypt_encrypt and mcrypt_decrypt functions in mcrypt library.
http://php.net/manual/en/function.mcrypt-encrypt.php http://www.php.net/manual/en/function.mcrypt-decrypt.php
If you're not concerned about security, you can just use rot13:
will give: