-1

This thread should not be for discussion on how bad ECB mode is, and that I should change it, but that BouncyCastle doesn't really support the mode, except for in Java, where you can use "getInstance". The code I am using is this, and it only decrypts the first block(0x1000 bytes) correctly.

BufferedBlockCipher Blowfish = new BufferedBlockCipher(new BlowfishEngine());
KeyParameter r3 = new KeyParameter(Blowfish_Key);
Blowfish.Init(false, r3);
Blowfish.ProcessBytes(pio.GetBuffer(), 0, (int)pio.Length, output, 0);

I guess the question here would be, is there a way to use ECB mode with the library, or are there any other classes I could use?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • A block should not be 0x1000 bytes, it is 8 to 32 bytes for symmetric encryption, above code should work, I think the error is elsewhere. – Maarten Bodewes Mar 19 '13 at 11:48
  • You are using ECB mode in your example. What makes you believe otherwise? – President James K. Polk Mar 19 '13 at 21:57
  • That it is not decrypting the other bytes. I used another program that used a different class and it worked. I figured out it was working in 8 bytes, so I guess that it is another problem. I'll keep trying other things. – user1953522 Mar 19 '13 at 22:25

1 Answers1

0

Figured it out. My file was probably corrupt, since I downloaded it again and it worked successfully.