Here you can find the source of loadCryptoProperties()
private static void loadCryptoProperties() throws IOException
//package com.java2s; //License from project: Creative Commons License import java.io.*; import java.util.*; public class Main { private static final String CRYPTO_PROPERTIES = "crypto.properties"; private static final String CRYPTO_KEY_ALGORITHM = "crypto.key_algorithm"; private static final String CRYPTO_RNG_ALGORITHM = "crypto.rng_algorithm"; private static final String CRYPTO_ITERATIONS = "crypto.iterations"; private static final String CRYPTO_SALT_LENGTH = "crypto.salt_length"; private static final String CRYPTO_KEY_LENGTH = "crypto.key_length"; private static String keyAlgorithm = "PBKDF2WithHmacSHA1"; private static String rngAlgorithm = "SHA1PRNG"; private static int iterations = 10 * 1024; private static int saltLength = 32; private static int keyLength = 256; private static void loadCryptoProperties() throws IOException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); Properties properties = new Properties(); InputStream is = cl.getResourceAsStream(CRYPTO_PROPERTIES); properties.load(is);/*from w w w . j a v a2 s. co m*/ keyAlgorithm = properties.getProperty(CRYPTO_KEY_ALGORITHM); rngAlgorithm = properties.getProperty(CRYPTO_RNG_ALGORITHM); String v = properties.getProperty(CRYPTO_ITERATIONS); iterations = Integer.parseInt(v); v = properties.getProperty(CRYPTO_SALT_LENGTH); saltLength = Integer.parseInt(v); v = properties.getProperty(CRYPTO_KEY_LENGTH); keyLength = Integer.parseInt(v); } }