public void DHPhase1() {
		// Prep DH
		dhParameters = new DHParameterSpec(prime, base);

		// Setup key generator
		keyGen = null;
		try {
			keyGen = KeyPairGenerator.getInstance("DH");
		} catch (NoSuchAlgorithmException e) {
			mylog.out("ERROR", "There is no DH algorithm available.");
		}
		try {
			keyGen.initialize(dhParameters, new SecureRandom());
		} catch (InvalidAlgorithmParameterException e) {
			mylog.out("ERROR", "Unable to intialize Key Generator.");
		}

		// Setup keying agreement
		keyAgree = null;
		try {
			keyAgree = KeyAgreement.getInstance("DH");
		} catch (NoSuchAlgorithmException e) {
			mylog.out("ERROR", "Unable to instantiate Key Agreement.");
		}
		keyPair = keyGen.generateKeyPair();

		try {
			keyAgree.init(keyPair.getPrivate());
		} catch (InvalidKeyException e) {
			mylog.out("ERROR", "Unable to calculate a private key for DH.");
		}
	}