Traceback spammers using an obfuscation of their URL

I have on occasion been forced to divulge my address to the odd enterprise, here and there. Some time later I've mysteriously found myself on the receiving end of spam. I have a plan to copy said enterprise's domain or part thereof to a bash terminal and obfuscate it, then paste the obfuscated string in the usually optional second line of the requested address.

Then, when spam turns up, I can un-obfuscate it and see which nefarious bugger thought it was OK to sell my details on. My first thought was to just use ROT13 but a long URL would remain long and almost anyone can reverse the string trivially - that's not awful but I'd rather keep the details to myself (and any hacker who could be bothered) - I tried '

echo <URL> |  gpg2 -ec

' but it wanted recipients and it's not really going anywhere, so I tried '

echo <URL> | gpg2 -ec --default-recipient-self

'

I clearly don't understand the details sufficiently but any suggestions that allow me to pipe in a URL to gpg or another candidate, supply a passphrase and then copy and paste the resulting string back to the address field AND take the string and reverse it back to the URL, with the same passphrase would be very helpful.

---------- Post updated at 10:13 PM ---------- Previous update was at 07:33 PM ----------

echo "domain.com" | mcrypt | uuencode >

I was expecting echo to pipe the string to mcrypt which then pipes the encrypted binary encoded string to uuencode which pipes its ASCII encoded output to std out, but this isn't happening!

I don' have mcrypt on my system, so I can't try it, but having a redirection operator at the end of a command with no output file specified is a syntax error. Did you try just using:

echo "domain.com" | mcrypt | uuencode

instead of using:

echo "domain.com" | mcrypt | uuencode >

You could use openssl eg:

$ PASS=testing

$ export PASS

$ echo "domain.com" |  openssl enc -e -aes-128-cbc -a -salt -pass env:PASS
U2FsdGVkX1+kygeSl5GyH8pIO8PLS8w6BNLHsErJyoE=

$ echo "U2FsdGVkX1+kygeSl5GyH8pIO8PLS8w6BNLHsErJyoE=" | openssl enc -d -aes-128-cbc -a -salt -pass env:PASS
domain.com

Edit: .. Or if you are after something a little shorter, you could drop the random salt and padding:

$ PASS=testing

$ export PASS

$ echo "domain.com" | openssl enc -a -e -aes-128-ctr -nopad -nosalt -pass env:PASS
Piq5KE6PVJ59PDg=

$ echo "Piq5KE6PVJ59PDg=" | openssl enc -a -d -aes-128-ctr -nosalt -pass env:PASS
domain.com