src/Security/Encryption.php
public static function valid($key, $cipher)
    {
        $keyLength = mb_strlen($key, '8bit');

        if (static::SUPPORTED_CIPHER_32_LENGTH === $keyLength
            && $cipher === static::SUPPORTED_CIPHER_32) {
            return true;
        }

        if (static::SUPPORTED_CIPHER_16_LENGTH == $keyLength
            && $cipher === static::SUPPORTED_CIPHER_16) {
            return true;
        }

        return false;
    }
public static function valid($key, $cipher)
    {
        $keyLength = mb_strlen($key, '8bit');

        if (static::SUPPORTED_CIPHER_32_LENGTH === $keyLength
            && $cipher === static::SUPPORTED_CIPHER_32) {
            return true;
        }

        if (static::SUPPORTED_CIPHER_16_LENGTH == $keyLength
            && $cipher === static::SUPPORTED_CIPHER_16) {
            return true;
        }

        return false;
    }
public static function valid ( $ key , $ cipher ) { $ keyLength = mb_strlen ( $ key , '8bit' ) ; if ( static :: SUPPORTED_CIPHER_32_LENGTH === $ keyLength && $ cipher === static :: SUPPORTED_CIPHER_32 ) { return true ; } if ( static :: SUPPORTED_CIPHER_16_LENGTH == $ keyLength && $ cipher === static :: SUPPORTED_CIPHER_16 ) { return true ; } return false ; }
Check if the given key and cipher have valid length and name.

@param $key
@param $cipher

@return bool
Check if the given key and cipher have valid length and name .