///////////////////////////////////////////////////////////////////////////
//文本简单的加密和解密
//////////////////////////////////////////////////////////////////////////const
  cKey = '随便你了';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;procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo2.Text := Decrypt(Encrypt(Memo1.Text, cKey), cKey);
end;