Forum Moderators: coopster & phranque

Message Too Old, No Replies

Blowfish PM

Blowfish PM Question

         

typomaniac

3:29 pm on Aug 5, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



The server host I use includes the Blowfish encryption module and the consistency with passwords matching the encrypted version has been spot on but only, when used with 8 char passwords.
Of the examples I found, the following (Blowfish) one works with consistent results but there is a limit of only 8 char passwords. I’m looking for something where I can use more than 8 characters. Is there anyway the code can be modified for that?
The password in the following is just random characters and not any actual password used for anything I know of.

use Crypt::Blowfish;
my $Blowfish_Key = "aqweRTY123$%^";
my $Blowfish_Cipher = new Crypt::Blowfish $Blowfish_Key;
### Remember, sentence has to be 8 long
my $Sentence = "q#eR#*12";
my $Encrypted = $Blowfish_Cipher->encrypt($Sentence);
my $Decrypted = $Blowfish_Cipher->decrypt($Encrypted);


I attempted to use the perl crypt function but that didn’t pan out too well.

csdude55

6:25 pm on Aug 15, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have no experience with this module. When you mentioned crypt in your other thread, I thought you meant this:

[perldoc.perl.org...]

I alluded to this on your other thread, but it might be easier to just use MD5. This will convert everything to a 32-character hash that you can store in MySQL with a defined length (marginally faster than allowing various sizes), and it wouldn't have the limitations you're experiencing.

typomaniac

3:59 pm on Aug 16, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



You got it right with what you thought I meant. I appreciate you answer--going with the MD5 system. Thanks again and have a great day!