Encrypt string and decrypt string

Hi

i have value in edit box some i want to encrypt, and be able to decypt it again

Esk
eskAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
IliadConnect With a Mentor Commented:
Try to use the following :-

const
   C1 = 52845;   {Used for encryption  Master Password string}
           C2 = 11719;
           Key = 1234;

        { Standard Decryption algorithm - Copied from Borland}
        function Decrypt(const S: String; Key: Word): String;
        var
          I: byte;
        begin
          Result[0] := S[0];
          for I := 1 to Length(S) do begin
            Result[I] := char(byte(S[I]) xor (Key shr 8));
            Key := (byte(S[I]) + Key) * C1 + C2;
          end;
        end;

        { Standard Encryption algorithm - Copied from Borland}
        function Encrypt(const S: String; Key: Word): String;
        Var
          I: byte;
        begin
          Result[0] := S[0];
          for I := 1 to Length(S) do begin
            Result[I] := char(byte(S[I]) xor (Key shr 8));
            Key := (byte(Result[I]) + Key) * C1 + C2;
          end;
        end;

Code copied from DIL
0
 
intheCommented:
delete this copy..
0
 
gikamCommented:
explain in detail what u really want to do
0
 
eskAuthor Commented:
upps, i was looking on wrong, but i have give you the points
thanks Barry
0
All Courses

From novice to tech pro — start learning today.