unit abCript;

interface

type
  TCripter = class
    class function Cript(s: string): string;
    class function Decript(s: string): string;
  end;



implementation

const
  sKey: string = 'x542345691hspwmx';

class function TCripter.Cript(s: string): string;
var
  i: integer;
begin
  Result := '';
  for i := 1 to length(s) do
    s[i] := chr((ord(s[i]) + ord(sKey[i mod length(sKey)])) mod 256);
  Result := s;
end;

class function TCripter.Decript(s: string): string;
var
  i: integer;
  i1: integer;
begin
  Result := '';
  for i := 1 to length(s) do
  begin
    i1 := ord(s[i]) - ord(sKey[i mod length(sKey)]);
    if  i1 < 0 then
      inc(i1, 256);
    s[i] := chr(i1);
  end;
  Result := s;
end;


end.
