If trying to generate my own user accounts for openfire. I need to encrypt the passwords, and so I use Blowfish to do this. Im using the Bouncycastle library for ASP.NET.
IBlockCipher blowFishCipher = new BlowfishEngine();
PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher(blowFishCipher);
ASCIIEncoding enc = new ASCIIEncoding();
byte keyByte = enc.GetBytes("thekey"); //key same as in passwordKey on openfire
cipher.Init(true, new KeyParameter(keyByte));
byte passwordBytes = enc.GetBytes("userpassword");
byte encryptPasswordBtyes = cipher.DoFinal(passwordBytes);
string encryptedPassword = Convert.ToBase64String(encryptPasswordBtyes);//enc.GetString(encryptPasswordBty es);
The problem i see is that in openfire the encryted passwords look like this b589c106c34e3da923b7cd8c0125b4a46a36a6384bebb874 whereas mine are coming out like this zHlWW/RqB2c= . And if i try and login with the new account it says the password is wrong.
Any ideas? things i should be aware of?