I'm having some issues with correlating the BlowsfishJ Java implementation (BlowfishJ Javadoc) to the dren Blowfish JavaScript implementation (dren Blowfish page).
On the Java side, I'm using Blowfish CBC, with a zero IV and the key is somekey. The plaintext is WillThisEQ.
On the JavaScript side, I PRESUME dren's implementation is using CBC and a zero IV, as well. The key is somekey and the plaintext is WillThisEQ, as well.
Here's the JavaScript code:
var bf = new Blowfish('some key');
var ciphertext = bf.encrypt('WillThisEQ');
var plaintext = bf.decrypt(ciphertext);
For the ciphertext, The first 8-bytes match for both implementations (WillThis). However, any subsequent bytes do NOT match (EQ000000). The IV is factored into the first block (Block Cipher Modes Wikipedia page). So, I don't think that's the problem.
How can I these two implementations to match?
Thank you very much for any help.
Your answer is at the very top of the dren BlowFish page you linked to:
You need to impliment your own cipher-block chaining if you want to encrypt anything longer than 8 bytes.
So no, it's not doing CBC. You could try the ECB version of BlowfishJ, but the security is much worse.