While cruising on one of my favorite haunts, alt.html, I found an advertisement for a WONDERFUL service that would encrypt your HTML pages and keep them free from prying eyes. The Javascript dependency is thrown in for FREE, even though it wouldn't too too hard to remove that "issue."
Suspecting something slightly less than advertised, I had to wander over and go look. Bored and curious, I stayed and decided to wander around their site even further.
First, allow me to present our guest for this evening,
Encryption Services.
Please, take a few moments to get to know our guest and make them feel suitable welcomed.
Then, wander over to the How it works and marvel at the secrets of Ascii to Hex conversions. If you'd like, copy the secret-encrypted message and change all of the '%' to ':' then visit a quick to Our friendly Hex-to-Ascii True, the hex-to-ascii site doesn't handle line feeds, but that hardly keeps us from seeing the secret password.
In our next WTF, the order page gives us the next WTF. $49.97. Need I say more?
Finally, for those of you who enjoy going into the world of WTF's, please continue as we get into the actual code of the deal. I'll short-cut you to the Member's Only page where you can click cancel to skip the password. Here, we take a quick look at some of the actual code used.
function hexfromdec(num) {
if (num > 65535) { return ("err!") }
first = Math.round(num/4096 - .5);
temp1 = num - first * 4096;
second = Math.round(temp1/256 -.5);
temp2 = temp1 - second * 256;
third = Math.round(temp2/16 - .5);
fourth = temp2 - third * 16;
return (""+getletter(third)+getletter(fourth));
}
function getletter(num) {
if (num < 10) {
return num;
}
else {
if (num == 10) { return "A" }
if (num == 11) { return "B" }
if (num == 12) { return "C" }
if (num == 13) { return "D" }
if (num == 14) { return "E" }
if (num == 15) { return "F" }
}
}
Compare that to these functions for converting hex and dec.
function d2h(d) {return d.toString(16);}
function h2d(h) {return parseInt(h,16);}
Then finally, our last WTF of the night.
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
Though I do suppose that begins to explain a lot.
For the non-javascript, not-html people, let me explain simply. You can't protect your HTML pages. You can't protect your images. You can slow down some people a tiny, tiny bit -- and cause problems for everyone else.