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

I'm using Dave Paris' Crypt::Blowfish encryption module. I'd like to decrypt some 40bit cyphertext from Enscrypt.   The problem is that Crypt::Blowfish requires a minimum keysize of 8 bytes and I can't match the 5 byte pass phrase used by Enscrypt (40).  In this case, 40-bit encrytion is more than enough for the job.

Is there any way to reduce the 8 byte minimum keysize, or do I have to pay for a stronger Enscrypt?

I've tried changing min_keysize from 8 to 5 in (line 35), but that doesn't work.  Maybe there is some way to use the keysize() method?

Fixed nbsp's- dvergin 2002-05-16

Replies are listed 'Best First'.
Re: Blowfish minimum keysize
by projekt21 (Friar) on May 16, 2002 at 08:32 UTC

    If you check Blowfish.xs (line 35) you will see:

    if (key_len < 8 || key_len > 56) croak("Invalid length key");

    You will also have to change this.

    I have not tested this. Good luck.

    alex pleiner <>
    zeitform Internet Dienste

      Absolutely right, Alex - changed these lines, perl Makefile.PL etc., and it works like a charm. Thank you very much.