Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Blowfish minimum keysize

by clerestorey (Novice)
on May 16, 2002 at 04:23 UTC ( [id://166916]=perlquestion: print w/replies, xml ) Need Help??

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 Blowfish.pm (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 <alex@zeitform.de>
    zeitform Internet Dienste

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

      James

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://166916]
Approved by ChemBoy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found