code: static String[] splitSecretIntoPieces(String secret, int n, int k)
              throws UnsupportedEncodingException
      {
          final BigInteger secretInteger;
          secretInteger = stringToBigInteger(secret);
          // secretInteger = BigInteger.valueOf(2L).pow(4096);
          final BigInteger modulus;
          // modulus = secretInteger.nextProbablePrime(); // OK
          // modulus =
          // secretInteger.multiply(BigInteger.valueOf(32L)).nextProbablePrime(); // FAILS
          // modulus = secretInteger.multiply(secretInteger).nextProbablePrime(); // OK
          // modulus = SecretShare.getPrimeUsedFor384bitSecretPayload(); // OK
          // modulus = SecretShare.getPrimeUsedFor4096bigSecretPayload(); // OK
          modulus = SecretShare.createAppropriateModulusForSecret(secretInteger); // OK
          final SecretShare.PublicInfo publicInfo = new SecretShare.PublicInfo(n,
                                                                               k,
                                                                               modulus,
                                                                               null);
          final SecretShare.SplitSecretOutput splitSecretOutput = new SecretShare(publicInfo)
                  .split(secretInteger);
          final List<ShareInfo> pieces = splitSecretOutput.getShareInfos();
          String[] out = new String[pieces.size()];
  
          for (int i = 0; i < out.length; i++)
          {
              final ShareInfo piece = pieces.get(i);
              out[i] = n + ":" + k + ":" + piece.getX() + ":" +
                       publicInfo.getPrimeModulus() + ":" + piece.getShare();
          }
          return out;
      }
docs: of them