public BigInteger genPrime(int pBits){
    	BigInteger p;
    	do {
            p = new BigInteger(pBits,rnd);
            if (p.mod(BigInteger.valueOf(2)).equals(BigInteger.ZERO)) continue;
			if (p.mod(BigInteger.valueOf(3)).equals(BigInteger.ZERO)) continue;
			if (p.mod(BigInteger.valueOf(5)).equals(BigInteger.ZERO)) continue;
			if (p.mod(BigInteger.valueOf(7)).equals(BigInteger.ZERO)) continue;
        } while (!miller_rabin(p));
    	return p;    	
    }