BigInteger b;
do{
b = new BigInteger(48, new SecureRandom());
} while (b.toString().length()!=14);
System.out.println(b.toString());
public static BigInteger generateBigInteger(int length, Random random) {
StringBuilder builder = new StringBuilder(length);
builder.append(random.nextInt(9) + 1);
for (int i = 1; i < length; i++) {
builder.append(random.nextInt(10));
}
return new BigInteger(builder.toString());
}