Manpages - zip_fopen_index_encrypted.3

libzip (-lzip)

The

function opens the encrypted file name

in

using the password given in the

argument. If

is

or the empty string, the default password is used (see

The

argument are the same as for

The

function opens the file at position

see

These functions are called automatically by

you only need to call them if you want to specify a non-default password (see

Upon successful completion, a

pointer is returned. Otherwise,

is returned and the error code in

is set to indicate the error.

No password was provided.

The function

may also fail and set

for any of the errors specified for the routine

The function

may also fail and set

for any of the errors specified for the routine

and

were added in libzip 1.0.

and

The zip file format provides very limited possibility for password verification (a short hash of is compared against one byte in the zip archive). For this reason, reading a file while using an incorrect password may immediately fail with

but if the mismatch is not detected, a zlib error may be returned later instead. Since zlib errors can also be caused by broken compressed data, there is no way to make sure if the password was incorrect or if it was correct, but the compressed data was invalid.

Author: dt

Created: 2022-02-21 Mon 12:53