Blowfish ECB Mode in BouncyCastle

喜夏-厌秋 提交于 2020-01-26 04:08:45

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/15490247/blowfish-ecb-mode-in-bouncycastle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!