Avoid Email Harvesting with a Clever Javascript Hack
One way spammers collect email addresses is by writing web crawlers—automated programs that scan the Web—that recognize and collect email addresses. To avoid email harvesting, many people refuse to publish their email address on the Web, or try to obfuscate their email address with something like the following:
anthony AT vance DOT org
However, despite being less readable and functional (e.g., no “mailto:” hyperlink), I am doubtful whether this really fools email harvesting web crawlers. After all, the above convention is widespread and is no less difficult to programatically recognize than a real email address.
I recently found (via Daring Fireball) a better solution: HiveLogic’s Enkoder, a clever Javascript hack that doesn’t compromise readability and yet still rigorously obfuscates email address from email harvesters. My email address,
is obfuscated in Javascript as:
function hiveware_enkoder(){var i,j,x,y,x=
"x=\"783d223136663631333936635c225c5c653232323d786139325c223d78366536653636" +
"33643531366436633232363533633264363037363663363132313665363036383733363532" +
"32363574722832363937692c322934363532293b7d793832323328276436353625272b7865" +
"3734322e73756265373737735c225c5c5c5c5c5c362b3d756e343666366573636133373536" +
"706538793b5c225c5c68366636653b692b3d3739347832297b793d3b303d69323233652872" +
"6f66363136653b27273d3734363b687432653665676e656c363136642e783c693635356328" +
"72343037366f667b293631366533363d2b363336356928366537346e696d2e363836666874" +
"614d366537393d6a656e67742b692c683734366674676e65336136316c2e78722869293b69" +
"3d3d303b693e6a2d2d3c782e6c3b2933365c5c744172615c5c5c5c3b793d68632e7827273b" +
"663d2b797b6f6176653d6a3b5c223b797d7d393362333b296a283033625c22736275732e78" +
"3d783b292930287441726168632e78286c2e783c693b303d6928726f663b27273d793b2931" +
"28727474736275732e783d2b797b29383d2b693b6874676e656c6e656c2e783c693b343d69" +
"28726f667d3b29342c69287269287274736275732e783d2b797b29383d2b693b6874673b29" +
"6a287274736275732e793d797d3b29342c223b793d27273b666f7228693d303b693c782e6c" +
"656e6774683b692b3d3233297b666f72286a3d4d6174682e6d696e28782e6c656e6774682c" +
"692b3233293b2d2d6a3e3d693b297b792b3d782e636861724174286a293b7d7d793b\";y='" +
"';for(i=0;i
Nice, yes? One drawback is that Javascript must be enabled or else nothing will be displayed. Still, this is a small concession to make for being able to post my real email address without fear of increased spam. I now include my email address in my footer as follows:
