i would like to use to encrypt and decrypt IRC messages via an IRC bot in NodeJS. This message uses CBC or ECB blowfish mircryption using block and base64 encryption.
I find information here:
Blowfish plugins for IRC seem to use the MODE_ECB (electronic code book), which is probably the least secure of the blowfish algorithms.
For encryption, they break the plaintext up into 8-byte chunks (the Blowfish ECB blocksize). They then encrypt each 8-byte block separately, and take the output of each encrypted block, and chunk that into (2) 4-byte longs, and base64encode each long, padding them to length of 6 base64 characters.
For decryption, this process is reversed, but because it's somewhat confusing I'll also describe that. Take 12 of the ciphertext bytes, decoding each 6-byte representation as a long ('>L'), so that you now have 8 bytes, which you then pass to the blowfish decryption algo.
Source :
IRC blowfish encryption mode? -
Block_cipher_mode_of_operation -
Java Code example what I found closest to javascript is here:
-
javascript-blowfish package-
egoroof-blowfish package tks!
EDIT :
The data transmitted by FiSH is not standard Base64. It uses
a nonstandard encoding table which you'll have to account for.