Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Compressing and Encrypting files on Windows

by elwarren (Priest)
on Nov 02, 2004 at 17:29 UTC ( [id://404682] : note . print w/replies, xml ) Need Help??

in reply to Re^2: Compressing and Encrypting files on Windows
in thread Compressing and Encrypting files on Windows

Please don't take this as sarcasm, but the very first line in the POD for the modules says:

Blowfish encryption algorithm implemented purely in Perl.

There are no calls to C and these can be used in place of the existing modules.

My suggestion had nothing to do with OS of choice. The PP modules will allow you to run the encryption code inline with your existing Perl and no forking or external process calls will be needed. Depending on how many calls you're making, this may be faster since you can avoid the context switch and overhead of starting an extproc.

This is why I referenced my POE example. POE doesn't like external programs because of it's own internal event loop signal handling. Using the PP modules allows me to avoid this.

Glad you got your code working. I'd be interested in what kind of performance you get, as I've been thinking about implementing something similar.
  • Comment on Re^3: Compressing and Encrypting files on Windows

Replies are listed 'Best First'.
Re^4: Compressing and Encrypting files on Windows
by hawtin (Prior) on Nov 03, 2004 at 09:07 UTC

    There are two different implementations of Blowfish in CPAN. As I said "the CPAN implementations of Blowfish and Rijndael I am using have binary elements" (note my wording). I know that there are Pure Perl implementations of Blowfish, and obviously you are using one of them. That was not the point of my question to you.

    From your posting (and your follow-up) you seem to be under the impression that using non-PurPerl modules requires forking or external process calls. Whereas I am using the faster XS implementation of Blowfish (which links against a dll) this also allows me to run the encryption code inline with my existing Perl.

    The benefit of Pure Perl modules comes at installation time (when you don't need a compiler), at run time I think the interface for the two implementations of Crypt::Blowfish are exactly the same. The XS version has the same interface and is faster so, as far as I can see the selection of a Pure Perl solution only makes sense in relation to your, as you put it OS of choice.

    So far the performance of my solution has turned out to be "good enough" (that is there are plenty of other places in the code that need attention before I will worry about it)

      My apologies. I've reread the thread and somehow I latched onto the first reply by an Anonymous Monk:

      Upgrade to 5.8.5, and read "perlfork" carefully. It has a section on how to do pipe-forks.