nusratfatma has asked for the wisdom of the Perl Monks concerning the following question:

Hi, The Application on which I'm working sents a cvs sheet as an attachment via Email to the user. I want this sheet to be password protected. Is there a way that the csv sheet could be zipped and a password attached to it ?

Replies are listed 'Best First'.
Re: Zipping a file in perl
by andreas1234567 (Vicar) on Dec 07, 2007 at 11:55 UTC
    The commonly used Archive::Zip module does not support zip encryption:
    The Archive::Zip module does not currently create or extract encrypted members.
    Besides the original, and according to wikipedia, seriously flawed PKZIP encryption algorithm, there are apparently differ implementations of zip file encryption: I'm unaware of any Perl interfaces to these implementations.

    There are a number of good alternatives to the above, try to search cpan or monastery.

    --
    Andreas
Re: Zipping a file in perl
by Fletch (Bishop) on Dec 07, 2007 at 14:15 UTC

    Rather than using zip's (as noted above, poor) encryption you could use something like Mail::GnuPG and gpg to encrypt the zip'd file after the fact instead.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.