en- and decrypting

C

checksumde

Hi Guys,

i've found a small java script function that simple
decrypts some encodedtext to plaintext.

function decrypt(t,k){
var y=0;
var r='';
t=unescape(t);
for (i=0;i<t.length;i++){
x=k.charCodeAt(y);
x2=t.charCodeAt(i);
if(x!=x2){
r=r+String.fromCharCode(x2^x);
}';x+='else{
r=r+String.fromCharCode(x);
}
y++;
if(y==k.length){
y=0;
}
}return(escape(r));
}

the problem is that i don't have the
encrypt function. i tried it by my own,
but i'm a noob using javascript in this way

can somebody help me to write this
encrypt function?


regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top