直接加密和解密算法{*******************************************************} { } { Decrypt } { } { bitwise compare of each characters XOR 27 } { } { Return string which after bitwise compare } { } {*******************************************************} function Decrypt(s: string; Key: Integer = 27): string; var i: Integer; begin Result := s; for i := 1 to Length(s) do Result[i] := Chr(Ord(s[i]) xor Key); end;{*******************************************************} { } { Encrypt } { } { Call again Decrypt to back to origin } { } { Return string which after bitwise compare } { } {*******************************************************} function Encrypt(s: string; Key : Integer =27): string; begin Result := Decrypt(s, Key); end;
{ }
{ Decrypt }
{ }
{ bitwise compare of each characters XOR 27 }
{ }
{ Return string which after bitwise compare }
{ }
{*******************************************************}
function Decrypt(s: string; Key: Integer = 27): string;
var
i: Integer;
begin
Result := s;
for i := 1 to Length(s) do
Result[i] := Chr(Ord(s[i]) xor Key);
end;{*******************************************************}
{ }
{ Encrypt }
{ }
{ Call again Decrypt to back to origin }
{ }
{ Return string which after bitwise compare }
{ }
{*******************************************************}
function Encrypt(s: string; Key : Integer =27): string;
begin
Result := Decrypt(s, Key);
end;