code: public static BigInteger createRandomModulusForSecret(BigInteger secret,
                                                            Random random)
      {
          final BigInteger ret;
          final int originalBitLength = secret.bitLength();
  
          final int ratioBigger = 5;  // 5 = 20% bigger
          final int numberOfBitsBigger = originalBitLength / ratioBigger;
  
          final int numbits = originalBitLength + numberOfBitsBigger;
          //System.out.println("Secret.bits=" + originalBitLength + " modulus.bits=" + numbits);
  
          // This could take a really long time, especially for 4000+ bits....
          ret = BigInteger.probablePrime(numbits, random);
  
          return ret;
      }
docs: NOTE: you should prefer createAppropriateModulusForSecret() over this method.
  
  @param secret as biginteger
  @param random you provide the random
  @return prime modulus big enough for secret*