private SecureRandom initSecureRandom(String algorithm, String provider)
			throws NoSuchAlgorithmException, NoSuchProviderException
	{
		LOGGER.fine("Initializing random with: " + algorithm + " : " + provider);
		if (provider == null)
			provider = PROVIDER_DEFAULT;

		// Create a secure random number generator
		SecureRandom sr = SecureRandom.getInstance(algorithm, provider);

		// Get 1024 random bits
		byte[] bytes = new byte[1024 / 8];
		sr.nextBytes(bytes);

		// Create two secure number generators with the same seed
		int seedByteCount = 10;
		byte[] seed = sr.generateSeed(seedByteCount);

		sr = SecureRandom.getInstance(algorithm, provider);
		sr.setSeed(seed);

		SecureRandom sr2 = SecureRandom.getInstance(algorithm, provider);
		sr2.setSeed(seed);
		return sr2;
	}