Mirror

Encrypt & DeCrypt (very simple algorithm) (Views: 7)


Problem/Question/Abstract:

How to Encrypt and DeCrypt string?

Answer:

Try this very simple algorithm

function TForm1.EnDeCode(const Value: string): string;
var
  CharIndex: Integer;
  ReturnValue: string;
begin
  ReturnValue := '';
  for CharIndex := 1 to Length(Value) do
  begin
    ReturnValue := ReturnValue + chr(not (ord(Value[CharIndex])));
  end;
  Result := ReturnValue;
end;

<< Back to main page