Skip navigation
3795 Views 4 Replies Latest reply: Jul 29, 2012 1:19 AM by John Gregson RSS
hardboy111 Bronze 16 posts since
Jan 10, 2010
Currently Being Moderated

May 20, 2010 7:30 AM

BlowFish Encryption Doesnt work with Openfire!

Hi All,

 

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?

 

Thanks

 

Mike

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points