private static String doEncrypt(final String value, final String file,
                                    final CasConfigurationJasyptCipherExecutor cipher) throws IOException {
        if (StringUtils.isNotBlank(file)) {
            val contents = FileUtils.readFileToString(new File(file), StandardCharsets.UTF_8);
            return cipher.encryptValue(contents);
        }
        return cipher.encryptValue(value);
    }
Encrypt a value using Jasypt.

@param value      the value
@param file       the file
@param alg        the alg
@param provider   the provider
@param password   the password
@param initVector the init vector
@param iterations the iterations - defaults to {@value StandardPBEByteEncryptor#DEFAULT_KEY_OBTENTION_ITERATIONS}
@throws Exception the exception
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/jasypt/JasyptEncryptPropertyCommand.java