Giter Site home page Giter Site logo

alvarlaigna / email-obfuscator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xpressyoo/email-obfuscator

0.0 3.0 0.0 138 KB

Easy-to-use substitution cipher encrypting via ROT13 email addresses to avoid them getting harvested by spam-bots while keeping the mailto: feature. It rests on JavaScript and includes a pure CSS fallback.

Home Page: http://rot13.florianbersier.com

License: MIT License

email-obfuscator's Introduction

Email Obfuscator

Easy-to-use substitution cipher encrypting via ROT13 email addresses to avoid them getting harvested by spam-bots while keeping the mailto: feature. It rests on JavaScript and includes a pure CSS fallback. See file "obfuscator.html" for more details.

ROT13 function (JavaScript)

String.prototype.rotate  = function() { 
            return this.replace(/[a-zA-Z]/ig, function(chr) {
            var cc = chr.charCodeAt(0);
            if (cc >= 65 && cc <= 90) cc = 65 + ((cc - 52) % 26);
            else if (cc >= 97 && cc <= 122) cc = 97 + ((cc - 84) % 26);
            else if (cc >= 48 && cc <= 57) cc = 48 + ((cc - 43) % 10);
            return String.fromCharCode(cc);
                			});
		};

Reverse strings (CSS fallback)

String.prototype.reverse = function() {

    return this.split( '' ).reverse().join( '' ); 
      
      };

Display & De-cipher the mailto

<span id="obf">
<script>
document.getElementById("obf").innerHTML="<n uers=\\"znvygb:' + email + subject +'\\">' + anchor + '</n>\".replace(/[a-z0-9]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});
</script>

where variables "email", "subject" and "anchor" have been retrieved from input fields and rotated thanks to the rotate() function.


Copyright (c) 2012 Florian Bersier | MIT Licensed

email-obfuscator's People

Watchers

Alvar Laigna avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.