Archive::Zip::Crypt - Unpacking of password protected archives for Archive::Zip
Version 0.02
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.
password()
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.
use Archive::Zip
Archive::Zip::Crypt
Set the encryption password on a member if called with an argument. Always returns the current password.
Matthias Bethke, <matthias at towiski.de>
<matthias at towiski.de>
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.
bug-archive-zip-crypt at rt.cpan.org
This was written as part of a project for 1&1 Internet AG. Thanks to them for supporting OSS!
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.
To install Archive::Zip::Crypt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Archive::Zip::Crypt
CPAN shell
perl -MCPAN -e shell install Archive::Zip::Crypt
For more information on module installation, please visit the detailed CPAN module installation guide.