function Encrypt(mStr: string; mKey: string): string; var I, J: Integer; begin J := 1; Result := ''; for I := 1 to Length(mStr) do begin Result := Result + Char(Ord(mStr[I]) xor Ord(mKey[J])); if J + 1 <= Length(mKey) then Inc(J) else J := 1; end; {自己加步骤} end;function Decrypt(mStr: string; mKey: string): string; var I, J: Integer; begin J := 1; Result := ''; {自己加步骤} for I := 1 to Length(mStr) do begin Result := Result + Char(Ord(mStr[I]) xor Ord(mKey[J])); if J + 1 <= Length(mKey) then Inc(J) else J := 1; end; end;
[email protected]
var
I, J: Integer;
begin
J := 1;
Result := '';
for I := 1 to Length(mStr) do begin
Result := Result + Char(Ord(mStr[I]) xor Ord(mKey[J]));
if J + 1 <= Length(mKey) then
Inc(J)
else J := 1;
end;
{自己加步骤}
end;function Decrypt(mStr: string; mKey: string): string;
var
I, J: Integer;
begin
J := 1;
Result := '';
{自己加步骤}
for I := 1 to Length(mStr) do begin
Result := Result + Char(Ord(mStr[I]) xor Ord(mKey[J]));
if J + 1 <= Length(mKey) then
Inc(J)
else J := 1;
end;
end;