haskell-crypto / cryptonite

lowlevel set of cryptographic primitives for haskell
Other
226 stars 139 forks source link

blowfish key size inconsistency #282

Closed mitchellwrosen closed 1 year ago

mitchellwrosen commented 5 years ago

I noticed that the Blowfish cipher declares a key size of between 6-56 bytes, and the BlowfishN variants declare an exact key size, but cipherInit accepts any key <= 56 bytes for all of them. Is that intentional?

ocheron commented 5 years ago

I think it's there to show a minimum which is not too weak. Wikipedia mentions a minimum of 32 bits like in the original papers. Internally blowfish repeats the byte sequence. Encryption result is not changed when appending a small key to itself.