How can i use blowfish/ecb/pkcs5padding decryption

The project I'm using employs blowfish/ecb/pkcs5padding to decrypt data. I want to convert this project to Rust code, but I haven't seen any crate doing this when I looked at other projects.

i used

use block_padding::Pkcs7;
use blowfish::cipher::{BlockDecryptMut, KeyInit};
use blowfish::Blowfish;
use ecb::Decryptor;

to check code: click here

Note that you don't need the ecb crate. ECB is "implemented" by the cipher itself, i.e. you can use the BlockDecrypt::decrypt_padded method.

1 Like