System.out.println("Public parameters for the cyclic group:");
System.out.println("p (" + p.bitLength() + " bits): " + p.toString(16));
System.out.println("q (" + q.bitLength() + " bits): " + q.toString(16));
System.out.println("g (" + p.bitLength() + " bits): " + g.toString(16));
System.out.println("p mod q = " + p.mod(q).toString(16));
System.out.println("g^{q} mod p = " + g.modPow(q, p).toString(16));
System.out.println("");
System.out.println("(Secret passwords used by Alice and Bob: " +
"\"" + alicePassword + "\" and \"" + bobPassword + "\")\n");