bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

Allow extended keys in BlowfishEngine for interoperability

Open jpboivin opened this issue 1 year ago • 0 comments

As discussed in https://github.com/bcgit/bc-csharp/issues/407, this is a proposal to support non-standard key sizes in the BlowfishEngine, for interoperability with other cryptographic libraries like OpenSSL and Nettle.

I want with an approach were by default, the key is still validated to be standard, but using the new BlowfishParameters, it is possible to lift the check for the engine to handle extended keys. If a key exceeds 576 bits, only the first 576 bits of the data will be used to compute the P box. This is in line with the OpenSSL and Nettle implementations.

I've generated test vectors using OpenSSL and Nettle. I couldn't find any online (even these libs do not seem to test larger keys): test_vectors.cpp.txt

jpboivin avatar Feb 09 '24 02:02 jpboivin