Check key and iv length. Handle variable key length ciphers