Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Encrypt string and decrypt string

Posted on 2000-02-21
4
Medium Priority
?
412 Views
Last Modified: 2010-04-04
Hi

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

Esk
0
Comment
Question by:esk
4 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2543517
delete this copy..
0
 
LVL 2

Expert Comment

by:gikam
ID: 2544902
explain in detail what u really want to do
0
 

Accepted Solution

by:
Iliad earned 400 total points
ID: 2549954
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
 

Author Comment

by:esk
ID: 2550878
upps, i was looking on wrong, but i have give you the points
thanks Barry
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question