Why CloudFlare’s e-mail protection is no longer safe

CloudFlare’s e-mail obfuscation

In the CloudFlare dashboard, you have an option to obfuscate e-mail addresses.
<span class="__cf_email__" data-cfemail="36534e575b465a53765b575f5a1855595b">[email&#160;protected]</span>

How it works

Decoding the e-mail key

function parseHex(string, position) {
var result = string.substr(position, 2);
return parseInt(result, 16);
}
function decode(href, startPos) {
var result = "";
var key = parseHex(href, startPos);
for(var position = startPos + 2; position < href.length; position = position + 2) {
var byte = parseHex(href, position) ^ key;
result = result + String.fromCharCode(byte);
}
return result;
}
function encode(mail) {
var key = Math.floor(Math.random()*256);
var result = ('0' + key.toString(16)).slice(-2);
for(var position = 0; position < mail.length; position++) {
var byte = mail.charCodeAt(position) ^ key;
result += ('0' + byte.toString(16)).slice(-2);
}
return result;
}

What is the problem?

What can I do about it?

The real solution

First article.

--

--

--

I write mainly about security and programming. I look for effecient solutions to problems. Programming and electronics are my passion.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

TestMace beta. Features overview, part 2

API Testing with Postman

So you skipped automated testing to move fast and break things. Now what?

You Can’t Be a Programmer without Understanding Logic

Installation and Initial Setup of Unity

Terraform AWS Provider 4.0 refactors S3 bucket resource

How Much Does it Cost to Hire a Remote Angular Developer?

Learning to Code — Part 4C: Conditionals and Loops — The For and Do-While Loops

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anton Vroemans

Anton Vroemans

I write mainly about security and programming. I look for effecient solutions to problems. Programming and electronics are my passion.

More from Medium

Yet another headbanger bug solved with a quick fix…

How to Brainly Improve Your Progressive Web App: Costs, Timeframes, Tips & Tricks, and Expert…

What is git and how does it work?

版本控制(version control)實在太重要了 (上) 你會, 錄取!