Two Anti-Spam Measures Against Email Address Harvesting
August 25, 2017
Let’s say we want to obfuscate the following mailto link:
<a href="mailto:example@email.com">Send a message</a>
Go for ASCII
<a href="mailto:example@email.com">Send a message</a>
Encode with JavaScript
Basic version:
<script type="text/javascript">
var username = "example";
var hostname = "email.com";
document.write("<a href='mailto:" + username + "@" + hostname + "'>Send a message</a>");
</script>
A cooler version using ROT13 alogrithm:
<script type="text/javascript">document.write("<n uers="znvygb:rknzcyr@rznvy.pbz">Fraq n zrffntr</n>".replace(/[a-zA-Z]/g,
function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
</script>