en- and decrypting

Discussion in 'Javascript' started by checksumde, Apr 28, 2004.

  1. checksumde

    checksumde Guest

    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
     
    checksumde, Apr 28, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marshall Dudley

    encrypting and decrypting with perl

    Marshall Dudley, Jan 27, 2005, in forum: Perl
    Replies:
    1
    Views:
    754
    Brian McCauley
    Jan 27, 2005
  2. =?Utf-8?B?QmlsbCBCb3Jn?=

    Error decrypting authentication ticket

    =?Utf-8?B?QmlsbCBCb3Jn?=, Oct 11, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    404
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Oct 11, 2004
  3. VB Programmer

    Encrypting/Decrypting Connection String

    VB Programmer, Nov 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    7,641
    Sahil Malik
    Nov 30, 2004
  4. Replies:
    0
    Views:
    1,484
  5. Marshall Dudley

    encrypting and decrypting with perl

    Marshall Dudley, Jan 27, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    332
    Brian McCauley
    Jan 27, 2005
Loading...

Share This Page