Is this classified information or not?
If this is a secret, you need a real encryption library as well as deep thinking to make sure your secret is kept secret. I would seriously think about never sending any secret to the browser.
If this is not a secret, and you just need to send it to the URL without getting borked, then escape () / unescape () is what you are looking for.
source share