!************************************** ! Name: Encrypt Function ! Description:This function will return a string XORed with the key you specify, using the same function you can decrypt an encrypted string as long the key used to dencrypt it is the one that is was encrypted with. ! By: Andrew Downing (from psc cd) ! ! ! Inputs:Text,Key ! ! Returns:XORed String ! !Assumes:None ! !Side Effects:XORed string will not display properly in an editbox or anything like that bacuase of nondisplayable charactars. !************************************** Function Encrypt(TextIn:string;Key:string):string; Var I,I2,Val,KeyLen: integer; begin KeyLen := length(Key); I2 := 1; For I := 1 to length(TextIn) do Begin Inc(I2,1); If I2 > KeyLen then Begin I2 := 1; End; Val := (ord(TextIn[I]) XOR ord(Key[I2])); Result := Result + char(Val); End; End;