protected BasicEncryptionConfiguration configureEncryptionSecurityConfiguration(final SamlRegisteredService service) {
        val config = DefaultSecurityConfigurationBootstrap.buildDefaultEncryptionConfiguration();
        LOGGER.trace("Default encryption blocked algorithms: [{}]", config.getExcludedAlgorithms());
        LOGGER.trace("Default encryption key algorithms: [{}]", config.getKeyTransportEncryptionAlgorithms());
        LOGGER.trace("Default encryption data algorithms: [{}]", config.getDataEncryptionAlgorithms());
        LOGGER.trace("Default encryption allowed algorithms: [{}]", config.getIncludedAlgorithms());

        val globalAlgorithms = samlIdPProperties.getAlgs();

        val overrideDataEncryptionAlgorithms = service.getEncryptionDataAlgorithms().isEmpty()
            ? globalAlgorithms.getOverrideDataEncryptionAlgorithms()
            : service.getEncryptionDataAlgorithms();
        if (overrideDataEncryptionAlgorithms != null && !overrideDataEncryptionAlgorithms.isEmpty()) {
            config.setDataEncryptionAlgorithms(overrideDataEncryptionAlgorithms);
        }

        val overrideKeyEncryptionAlgorithms = service.getEncryptionKeyAlgorithms().isEmpty()
            ? globalAlgorithms.getOverrideKeyEncryptionAlgorithms()
            : service.getEncryptionKeyAlgorithms();
        if (overrideKeyEncryptionAlgorithms != null && !overrideKeyEncryptionAlgorithms.isEmpty()) {
            config.setKeyTransportEncryptionAlgorithms(overrideKeyEncryptionAlgorithms);
        }

        val overrideBlockedEncryptionAlgorithms = service.getEncryptionBlackListedAlgorithms().isEmpty()
            ? globalAlgorithms.getOverrideBlockedEncryptionAlgorithms()
            : service.getEncryptionBlackListedAlgorithms();
        if (overrideBlockedEncryptionAlgorithms != null && !overrideBlockedEncryptionAlgorithms.isEmpty()) {
            config.setExcludedAlgorithms(overrideBlockedEncryptionAlgorithms);
        }

        val overrideWhiteListedAlgorithms = service.getEncryptionWhiteListedAlgorithms().isEmpty()
            ? globalAlgorithms.getOverrideAllowedAlgorithms()
            : service.getEncryptionWhiteListedAlgorithms();
        if (overrideWhiteListedAlgorithms != null && !overrideWhiteListedAlgorithms.isEmpty()) {
            config.setIncludedAlgorithms(overrideWhiteListedAlgorithms);
        }

        LOGGER.trace("Finalized encryption blocked algorithms: [{}]", config.getExcludedAlgorithms());
        LOGGER.trace("Finalized encryption key algorithms: [{}]", config.getKeyTransportEncryptionAlgorithms());
        LOGGER.trace("Finalized encryption data algorithms: [{}]", config.getDataEncryptionAlgorithms());
        LOGGER.trace("Finalized encryption allowed algorithms: [{}]", config.getIncludedAlgorithms());

        if (StringUtils.isNotBlank(service.getWhiteListBlackListPrecedence())) {
            val precedence = AlgorithmPolicyConfiguration.Precedence.valueOf(
                service.getWhiteListBlackListPrecedence().trim().toUpperCase(Locale.ENGLISH));
            config.setIncludeExcludePrecedence(precedence);
        }
        return config;
    }
Configure encryption security configuration.

@param service the service
@return the basic encryption configuration
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlIdPObjectEncrypter.java