The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Archive::Zip::Crypt - Unpacking of password protected archives for Archive::Zip

VERSION

Version 0.02

SYNOPSIS

This is a little hack that adds the capability to unpack password-protected archives to Archive::Zip. It adds a password() method to Archive::Zip::Member (passwords may be different for different archive members!) and overwrites a few others so they can use the decryption functionality, so it may break wit Archive::Zip versions >1.30. This is a pure Perl implementation and really slow as bit-fiddling stuff in Perl tends to be.

    use Archive::Zip;
    use Archive::Zip::Crypt;

    my $zip = Archive::Zip->new($archive_name) or die "can't unzip";
    foreach my $member_name ($zip->memberNames) {
        my $member = $zip->memberNamed($member_name);
        next if $member->isDirectory;
        $member->password($password);
        my $contents = $zip->contents($member) or die "error accessing $member_name";
    }

Note: it is important to use Archive::Zip first, so Archive::Zip::Crypt can smear its bugs all over the former's namespace.

METHODS

Archive::Zip::Member::password($password)

Set the encryption password on a member if called with an argument. Always returns the current password.

AUTHOR

Matthias Bethke, <matthias at towiski.de>

BUGS

None known but highly likely to be there. Please report any bugs or feature requests to bug-archive-zip-crypt at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Archive-Zip-Crypt. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

This was written as part of a project for 1&1 Internet AG. Thanks to them for supporting OSS!

LICENSE AND COPYRIGHT

Copyright 2008-2012 Matthias Bethke.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.