хех, хватит с вас этого куска:
delphi Код:
const
fKey: array[0..3] of Byte = ($00,$f0,$ff,$01); //начальный ключ
procedure TCrypt.EncData(pData: PByte; size: Integer);
var
b: Byte;
i: Cardinal;
begin
for i:=encPos to encPos+size-1 do begin
pData^:=pData^ xor encKey[i and 3];
Inc(pData);
if(i and 7 = 7)then begin
b:=encKey[2];
if((encKey[1]and $f)=0)and(encKey[0]=0)then Inc(PCardinal(@encKey)^,$2000);
Dec(PCardinal(@encKey)^,$00020001);
if(b<2)and(encKey[2]>$fa)and(encKey[3]and $01=1)then Inc(encKey[3],4);
end;
end;
encPos:=i;
end;
procedure TCrypt.DecData(pData: PByte; size: Integer);
var
b: Byte;
i: Cardinal;
begin
for i:=decPos to decPos+size-1 do begin
pData^:=pData^ xor decKey[i and 3];
Inc(pData);
if(i and 7 = 7)then begin
b:=decKey[2];
if((decKey[1]and $f)=0)and(decKey[0]=0)then Inc(PCardinal(@decKey)^,$2000);
Dec(PCardinal(@decKey)^,$00020001);
if(b<2)and(decKey[2]>$fa)and(decKey[3]and $01=1)then Inc(decKey[3],4);
end;
end;
decPos:=i;
end;