Sunday, October 5, 2008

Introducing Liame

Liame is an open source server control for ASP.NET that obfuscates email addresses in a web page, using javascript and other techniques to hide them from spammers.

In a nutshell, Liame takes the arguments specified by the user and constructs a complete HTML <a href="mailto:..."> tag. This tag is encoded using one of the available algorithms, and then it generates the javascript functions that writes the decoded link into the page. Liame supports four algorithms out of the box:
  • ROT(N) encoding, where N is a random number choosen at runtime
  • Base64 encoding
  • Hexadecimal encoding, that converts the tag in a sequence of hexadecimal character codes
  • Null encoding, which was used for testing and as starting point to develop new algorithms.
Each of them is implemented in a class that includes the encoding algorithm as well as the javascript code needed to Liame in the Toolbardecode it, that must inherit from a base Codec class. These codecs include some other obfuscation techniques, such as splitting the string, replacing some special characters, or generate distinct variable and function names in each execution, that may help to hide the email address from spammers. By the way, you can develop your own Codec and tell the control to use it quite easily.

Yes but... what happens if the user has disabled javascript? The control can also generate a <noscript> tag including some known CSS obfuscation techniques, such as inserting invisible tags or changing the text direction of the email address. In this case, the email will be shown without the mailto: link.

To use Liame in your developments, you have to download it from Google Code, and add a reference to the assembly Liame.dll in your project. You could also insert the component in your Visual Studio's toolbar, so you'll be able to drag and drop the control into your page or masterpage.

But wait, that's not all. Using Liame's technology it is possible to generate javascript code ready to use in your pages, regardless of the server language or development platform. So you can enjoy Liame obfuscation with HTML, PHP, Java and so on, just using the Liame javascript on-line generator. It'll help you to generate code that you can copy and paste into your page, like the following example, which renders a mailto link:

Generated javascript

The ASP.NET server control, as well as a demonstration project, is released under a BSD license. You can download the code at the project's home, in Google Code.

Please, feel free to send me your comments, suggestions, opinions or new ideas to get a more effective obfuscation.

Welcome to Liame.

1 comment:

Anonymous said...

Great job!!!