Author image Matthias Bethke
and 2 contributors


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.

    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;
        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.



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


Matthias Bethke, <matthias at>


None known but highly likely to be there. Please report any bugs or feature requests to bug-archive-zip-crypt at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


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 for more information.