RustCrypto / block-ciphers

Collection of block cipher algorithms written in pure Rust
677 stars 130 forks source link

Blowfish/cbc with different key size #388

Closed zenzille closed 1 year ago

zenzille commented 1 year ago

I'm trying to use blowfish+cbc with a key size of 256 like this:

type BlowfishCbcEnc = cbc::Encryptor<blowfish::Blowfish>;
let ct = BlowfishCbcEnc::new(&key.into(), &iv.into())...

But I can't find a way to pass a key size other than 448 bits. It looks like blowfish itself supports different sizes. Is there a way to accomplish my goal?

newpavlov commented 1 year ago

new_from_slices should accept 256 bit keys.

zenzille commented 1 year ago

Ah. That even works through Encryptor. Thanks.