0

I would like to use BouncyCastle and decrypt a text using Blowfish/ECB/NoPadding, I can create a Blowfish engine using:

BlowfishEngine engine = new BlowfishEngine();

But after that I'm not sure how to create a cypher to decrypt using ECB and NoPadding. I also tried to use:

WrapperUtilities.GetWrapper("Blowfish/ECB/NoPadding")

But then I can't use cipher.doFinal like I would do with a Cipher

How can I do it?

TePi
  • 37
  • 6

1 Answers1

0

It would be CipherUtilities.GetCipher("Blowfish/ECB/NoPadding") rather than WrapperUtilities. Since it's ECB/NoPadding, it would amount to wrapping BlowfishEngine with a BufferedBlockCipher (i.e. new BufferedBlockCipher(engine)). This really only adds buffering. Since there's no padding the data will have to be block-aligned. If you are receiving the input one block at a time (or have it all in an array already), it might be simpler to just use BlowfishEngine directly (i.e. as an IBlockCipher).

Peter Dettman
  • 3,867
  • 20
  • 34