0 notes &
More or less safe
After some though, I decieded not to send user passwords unencrypted. :P So I’ve come up with this JavaScript function. Anyone can see it on the source code anyway, so why not post it here. I have obfuscated the code a bit so I wont just hand out the algorithm. If you can come up with the decryption algorithm, I shall buy you a beer, promise.
function encriptar(xD, mensaje){ /*--------------------------------------------------*/ var __ = xD; var _ = parseInt(Math.random()*32); var ____ = ""; for (o_O=0;o_O<__.length; o_O++) { u_U = parseInt(__.charCodeAt(o_O)); if(o_O%2==0 ) u_U += _; else u_U -= _; var $_$ = u_U.toString(2); while( $_$.length < 9) $_$ = "0" + $_$; ____ += $_$; } _ = parseInt(_).toString(2); while( _.length < 9 ) _ = "0" + _; __ = _ + "" +____;var ___ = ""; var _____ = 0; for( i = 0; i < __.length; i++){ ___ += __.charAt(i) == 0 ? mensaje.charAt(_____) : mensaje.charAt( _____ ).toUpperCase(); if(_____ == (mensaje.length - 1)) _____ = 0; else _____++; /* alanBoy */ } return ___; /*--------------------------------------------------*/ }
This is the actual code at clubdeprogra.com so if you do find a bug, I trust you will tell me.