Thursday, January 15, 2009

Obscuring URLs

I stumbled upon an old article today entitled How to Obscure Any URL: How Spammers And Scammers Hide and Confuse. Quoting from its summary, the article describes three ways to obscure URLs:
  1. Meaningless or deceptive text can be added after "http://" and before an "@" symbol.
  2. The domain name can be expressed as an IP address, in dotted-decimal, dword, octal or hexadecimal format.
  3. Characters in the URL can be expressed as hexadecimal (base 16) numbers
Two more ways come to mind that are most useful if you are building your own website:
  1. Use indices or hashes for object references. For example, www.mywebsite.com/myapp?objectref=1.
  2. Use a hash function (say MD5 or SHA-1) to hash the URL and use the result as a key to the real URL. For example, www.mywebsite.com/this/is/a/private/path might become www.mywebsite.com/f061a171dfc30635462850684f98b886. This is similar to what URL shortening services such as TinyUrl do.
References
  1. How to Obscure Any URL: How Spammers And Scammers Hide and Confuse, www.pc-help.org, 2002