你的接口在哪里的呀?[/quote]
The zip_set_default_password() function sets the default password used when accessing encrypted files. If password is NULL, the default password is unset.
If you prefer a different password for single files, use zip_fopen_encrypted(3) instead of zip_fopen(3). Usually, however, the same password is used for every file in an zip archive.
这是解密的,没有加密的接口
struct zip *za;
struct zip_file *zf;
struct zip_stat sb;
char buf[100];
long long sum;
int len;
int test;
int err;
int fd;
za = zip_open("/home/alex/Documents/Teste_Libzip.zip", 0, &err);
if (!za) {
return 1;
}
zip_set_default_password(za, "xxx");
zf = zip_fopen(za, "remote_access_aaa.txt", ZIP_FL_ENCRYPTED);
if (!zf) {
return 3;
}
len = zip_fread(zf, buf, 100);