This is because Blowfish has a given block size of 64 bits. You can place two random bytes at the end of your data.
require 'rubygems'
require 'crypt/blowfish'
blowfish = Crypt::Blowfish.new("A key up to 56 bytes long")
plain="123456"
encryptedBlock = blowfish.encrypt_block(plain+(rand(250)+5).chr+(rand(250)+5).chr)
or if yours plainmay be less than 6 bytes / 48 bits
encryptedBlock = blowfish.encrypt_block(plain.ljust(8))
source
share