/**
* Implementare a algoritmului XOR. 
* http://www.guymal.com/mycode/xor_js_encryption/
*/

function encrypt(to_enc)
{	
	var xor_key = 2;
	var the_res="";//the result will be here
	for(i=0;i<to_enc.length;++i)
	{
		the_res+=String.fromCharCode(xor_key^to_enc.charCodeAt(i));
	}
	return the_res;
}

function decrypt(to_dec)
{
	var dec_res = "";
	var xor_key = 2;
	
	for(i=0;i < to_dec.length; i++)
	{
		dec_res += String.fromCharCode(xor_key^to_dec.charCodeAt(i));
	}

	return dec_res;
}

