( ) - 7


prev = crc32(prev, pgamma+i, 1); //

}

}

:

int cryptfile(int encrypt, char *fn, unsigned char *pw, unsigned pwlen)

{

FILE * f = fopen(fn, "r+b");

unsigned char * buf, * gamma;

unsigned buflen;

if(!f)

return -1;

buflen = filelength(f->fd);

buf = new char[buflen];

gamma = generate_gamma(pw, pwlen, buflen<<2);

fread(buf, buflen, 1, f);

if(encrypt)

encrypt(buf, buflen, gamma);

else

decrypt(buf, buflen, gamma);

rewind(f);

fwrite(buf, buflen, 1, f);

memset(buf, 0xff, buflen);

memset(buf, 0, buflen);

memset(gamma, 0xff, buflen<<2);

memset(gamma, 0, buflen<<2);

delete buf;

delete gamma;

fclose(f);

return 0;

}

. , , , , (, ) 0.5%. RAR solid- ( ;). . . . , . , .