This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

blowfish/base64 encryption

Old posts that have not been replied to for several years.
Locked
m
mortician
Voice
Posts: 37
Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:

blowfish/base64 encryption

Post by mortician »

hey,

I'm making some perl script (not for eggdrop) and it needs the same encryption as an eggdrop (encrypt <key> <string> / decrypt <key> <encrypted-base64-string>)

As I can read in the docs, eggdrop encrypts the string via blowfish first (since that's the encryption module I've loaded), and next encodes it in a base64 String.

However, when I try this in my perl script I don't get the same result (endoding or decoding)

I know this is not a perl forum, but this is the perl I have:

Code: Select all

my $key = "my key";
my $cipher = new Crypt::Blowfish $key;

# encryption:
my $ciphertext = $cipher->encrypt("a_string");  #encrypt with blowfish
my $in = encode_base64($ciphertext); # encode with base64
# $in should be the encrypted base64 string now ...

# decryption:
my $out = decode_base64($in); # decoding base64
my $plaintext = $cipher->decrypt($out); # decrypting blowfish
Someone knows why this is not the same?
It is a mistake to think you can solve any major problems just with potatoes.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Afaik you need a blowfish with the same salts used in eggdrop (check the source for details). I've no idea if/how they can be inserted into the blowfish module you're using though.
N
Nimo
Voice
Posts: 11
Joined: Sun May 04, 2003 8:29 am

Post by Nimo »

//Nimo
m
mortician
Voice
Posts: 37
Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:

Post by mortician »

thanks, I know what to look for now ...

btw Nimo, that prog would be very usefull if it was a decoder and not an encoder :wink: unfortunately I do not know any c(++) so I can't make it myself :)
It is a mistake to think you can solve any major problems just with potatoes.
Locked