Using a too-short key when initializing a cipher using OpenSSL can lead to a serious problem: the OpenSSL API will still accept this key as valid and simply read out of bounds when the cipher is initialized, potentially initializing the cipher with a weak key and leaving your data vulnerable. In order to check if a given key has the correct size, we need to know two things: the size of the key and the key size of the cipher the key is passed to. Let’s first define a member predicate on the Key type that checks the size of the key against the key size of a given cipher.