-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathobfuscator.html
More file actions
164 lines (142 loc) · 7.33 KB
/
obfuscator.html
File metadata and controls
164 lines (142 loc) · 7.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<!--MIT LICENSED-->
<html itemscope itemtype="http://schema.org/Product">
<head>
<title>Email Obfuscation via ROT13 Cypher</title>
<!-- metadata-->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="keywords" content="ROT13,algorithm,converter,javascript,tool,online,free" />
<meta name="author" content="Florian Bersier" />
<meta name="Description" content="An easy-to-use substitution cipher that encrypts via ROT13 your email addresses to avoid them getting harvested by spam-bots while keeping the mailto: feature." />
<!-- favicon -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<!-- css stylesheet-->
<style>
body{margin:0;padding:0;width:100%;font:1em Helvetica,Arial,sans-serif;color:#333;}
a{text-decoration:none}a:hover{text-decoration:underline}
ul p{margin:4px 0}
.wrapper{width:980px;margin:0 auto;}
h1{margin-top:6%}p.i{line-height:24px;margin-bottom:25px}
ul{list-style:none;padding:0;margin:0 0 0 8%}ul li{display:inline-block;vertical-align:top}ul li:first-child{margin-right:60px}
input[type="text"]{padding:3px 10px;border:1px solid #eee;width:230px}
label{display:inline-block;width:110px}label.lg{width:180px;margin-left:40px}
.tip{color:#999;font-size:0.75em;line-height:14px}
.info{position:absolute;display:none;margin-left:300px;width:360px;height:25px;background:lightyellow;line-height:25px;text-align:center;font-size:13px;border-left:3px dashed #f1f1f1;border-right:3px dashed #f1f1f1}
textarea{width:90%;border:25px solid #f1f1f1;padding:15px;line-height:20px;outline:none;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px}
.footer{color:#999;font-size:0.85em;text-align:center}
ul.share{position:absolute;top:9%;margin-left:580px;width:440px}ul.share li{display:inline-block;margin:0}
</style>
</head>
<body><div id="fb-root"></div>
<script>
// ASYNC
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
add = function(url, id) {
if (doc.getElementById(id)) {return;}
js = doc.createElement(script);
js.src = url;
id && (js.id = id);
fjs.parentNode.insertBefore(js, fjs);
};
// Google+ button
add('https://apis.google.com/js/plusone.js');
// Facebook SDK
add('//connect.facebook.net/en_US/all.js#xfbml=1&appId=205602882797935', 'facebook-jssdk');
// Twitter SDK
add('//platform.twitter.com/widgets.js', 'twitter-wjs');
// HN
add('http://hnbutton.appspot.com/static/hn.js');
}(document, 'script'));
</script>
<!--Place the code below where you want the link to be displayed-->
<script>var eo=document.createElement("span");eo.innerHTML="<n uers=\"znvygb:uv12@sybevnaorefvre.pbz\" gnetrg=\"_oynax\">uv12@sybevnaorefvre.pbz</n>".replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});document.body.appendChild(eo);</script>
<noscript><span style="unicode-bidi:bidi-override;direction:rtl;">moc.reisrebnairolf@21ih</span></noscript>
<div class="wrapper">
<h1>Email Obfuscator</h1>
<p class="i">This easy-to-use <a href="http://en.wikipedia.org/wiki/Substitution_cipher" target="_blank" title="What is it?">substitution cipher</a> encrypts via ROT13 your email addresses to avoid them getting harvested by spam-bots while keeping the <i>mailto:</i> feature. It rests on JavaScript and includes a pure CSS fallback. Feel free to bookmark it and share it!</p>
<ul>
<li>
<p><label for="email">Email Address</label><input type="text" class="zz" id="email" value="" /></p>
<span class="tip">Type the email address you want to obfuscate.</span>
<li>
<p><label for="anchor">Anchor text</label><input type="text" class="zz" id="anchor" value="" /></p>
<span class="tip">The visible, clickable text attached to the mailto link, <i>eg</i> "Contact us".</span>
</ul>
<br />
<ul>
<li>
<p><label for="subject">Email Subject</label><input type="text" id="subject" value="" /></p>
<span class="tip">The subject attached to the mailto if any, <i>eg</i> "Information request".</span>
<li>
<p><label for="html5">HTML5 syntax</label><input checked="checked" id="html5" type="checkbox"></p>
<li>
<p><label class="lg" for="target">Open link in new window</label><input checked="checked" id="target" type="checkbox"></p>
</ul>
<br /><br /><div class="info">Once done, copy and paste the code below</div><textarea id="result"></textarea>
<div class="footer">
<p>Developed by <a href="http://www.florianbersier.com">Florian Bersier</a> – 2012 | MIT Licensed</p>
</div><!--#footer-->
<ul class="share">
<li><a href="http://news.ycombinator.com/submit" class="hn-share-button" data-url="http://rot13.florianbersier.com/">Vote on HN</a>
<li class="go"><div class="g-plusone" data-size="medium"></div>
<li><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="xpressyoo">Tweet</a>
<li><div class="fb-like" data-href="http://rot13.florianbersier.com/" data-send="false" data-layout="button_count" data-width="70" data-show-faces="false"></div>
</ul><!--#share-->
</div>
<!--jQuery-->
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
// Style
$('input').focus(function() { $(".info").css('display','block'); });
// FNs
// Reverse strings (CSS fallback)
String.prototype.reverse = function() { return this.split( '' ).reverse().join( '' ); };
// ROT13 function
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);
});
};
// INIT
$("#html5").change(function () {
if ($(this).is(':checked')){var ht = '';}else{var ht = ' type="text/javascript"';}
$("#target").change(function () {
if ($(this).is(':checked')){var target = 'gnetrg=\\"_oynax\\"';}else{var target = '';}
$("input").keyup(function () {
var email = $("#email").val();
var emailrev = email.reverse();//Noscript
var anchor = $("#anchor").val();
var subject = $("#subject").val();
// ROT13
var emailb = email.rotate();
var anchorb = anchor.rotate();
var subjectb = '?fhowrpg=' + subject.rotate();
// OUTPUT
if (subject === ''){var subjectb = '';$('#result').css('height','120px');}else{$('#result').css('height','130px');}
var help = '<!--Place the code below where you want the link to be displayed-->';
var noscript = '<noscript><span style="unicode-bidi:bidi-override;direction:rtl;">' + emailrev + '</span></noscript>';
var code = help + '\n<script'+ ht +'>'+'var eo=document.createElement("span");eo.innerHTML="<n uers=\\"znvygb:' + emailb + subjectb +'\\" '+ target +'>' + anchorb + '</n>\".replace(/[a-z0-9]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});document.body.appendChild(eo);'+'<\/script>\n' + noscript;
$("#result").val(code);
}).keyup();
}).change();
}).change();
$("#result").focus(function() {
$this = $(this);
$this.select();
// Work around Chrome's little problem
$this.mouseup(function() {
// Prevent further mouseup intervention
$this.unbind("mouseup");
return false;
});
});
</script>
</body>
</html>