de-obfuscate an obfuscated email

This commit is contained in:
ansuz 2016-07-11 11:07:59 +02:00
parent 3bdfee71e1
commit 88a3c4227b
3 changed files with 40 additions and 4 deletions

23
customize.dist/email.js Normal file
View File

@ -0,0 +1,23 @@
define(function () {
var Email = {};
var patt = /./g;
var each = function (d) {
d = d || 1;
return function (c, i) {
return String.fromCharCode((c.charCodeAt(0) + d));
};
};
Email.makeScrambler = function (n) {
return {
encrypt: function (S) {
return S.replace(patt, each(n));
},
decrypt: function (S) {
return S.replace(patt, each(-n));
}
};
};
return Email;
});

View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Cryptpad :: Zero Knowledge, Collaborative Real Time Editing</title>
<title>Cryptpad: Zero Knowledge, Collaborative Real Time Editing</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<link rel="stylesheet" type="text/css" href="customize/main.css" />
<link rel="icon" type="image/png" href="/customize/favicon.png" id="favicon"/>
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<script data-main="/customize/main" src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/requirejs/require.js"></script>
<!-- Piwik -->
@ -40,7 +40,7 @@
</code></pre><h2 id="howitworks">How It Works</h2>
<p>CryptPad uses a variant of the <a href="https://en.wikipedia.org/wiki/Operational_transformation">Operational transformation</a> algorithm which is able to find distributed consensus using a Nakamoto Blockchain, a construct popularized by <a href="https://en.wikipedia.org/wiki/Bitcoin">Bitcoin</a>. This way the algorithm can avoid the need for a central server to resolve Operational Transform Edit Conflicts and without the need for resolving conflicts, the server can be kept unaware of the content which is being edited on the pad.</p>
<p>If you have any questions or comments, you can <a href="https://github.com/xwiki-labs/cryptpad/issues/" title="our issue tracker">open an issue on github</a>, or come say hi on irc (<a href="http://webchat.freenode.net?channels=%23cryptpad&uio=MT1mYWxzZSY5PXRydWUmMTE9Mjg3JjE1PXRydWUe7" title="freenode webchat">irc.freenode.net</a>).</p>
<p>If you have any questions or comments, you can <a href="https://github.com/xwiki-labs/cryptpad/issues/" title="our issue tracker">open an issue on github</a>, come say hi on irc (<a href="http://webchat.freenode.net?channels=%23cryptpad&uio=MT1mYWxzZSY5PXRydWUmMTE9Mjg3JjE1PXRydWUe7" title="freenode webchat">irc.freenode.net</a>), or <a href="mailto:sftfbsdiAyxjlj/dpn">send us an email</a>.</p>
<center>
<noscript>

View File

@ -2,9 +2,22 @@ define([
'/customize/DecorateToolbar.js',
'/common/cryptpad-common.js',
'/bower_components/lil-uri/uri.min.js',
'/common/email.js',
'/bower_components/jquery/dist/jquery.min.js',
], function (DecorateToolbar, Cryptpad, LilUri) {
], function (DecorateToolbar, Cryptpad, LilUri, Email) {
var $ = window.$;
var email = Email.makeScrambler(1);
// slip past the spammers, then unscramble mailto links
$('a[href^="mailto:"]').each(function () {
$(this).attr('href', function (i, href) {
return href.replace(/:(.*$)/, function (a, address) {
return ':' + email.decrypt(address);
});
});
});
DecorateToolbar.main($('#bottom-bar'));
Cryptpad.styleAlerts();