Ruby openssl problem

Hi all,

I have run into a problem using the ruby openssl module to do blowfish encryption.

I have found that messages encrypted in ruby can de decrypted by ruby, but messages encrypted in perl or php cannot be decrypted by ruby, and visa versa. The perl and php scripts have no problem with each others messages, so I am wondering if there is anything specific I could be doing wrong.

Can anyone comment of the following code:

require 'openssl'
require 'base64'

blowfish = OpenSSL::Cipher::Cipher.new('BF-ECB')
blowfish.encrypt("somekey")
msg = blowfish.update("hello world")
msg << blowfish.final
b64 = Base64.encode64(msg)

The base64 encoded message can be decoded in ruby by reversing the process, but the same data send to php or perl fails to decrypt.

Can anyone shed any light on this?

Cheers,

--Ed