Skip to content
CP-MCP
Get Support

Generating passphrases

core.generate_passphrase is a utility on the core object that mints memorable word-list passphrases such as apple-red-truck. It does not proxy a Cloudpath REST call — it draws words from a bundled word list and hands the strings back to your code, where you can feed them straight into a core.call(...) in the same code_mode invocation.

The intended use is seeding Cloudpath DPSK pools, MPSK entries, and registration-list passwords: mint the secret and store it in one call, so the generated value never round-trips the MCP transport before Cloudpath has it.

ParameterRangeDefaultMeaning
count1–1001How many passphrases to generate
wordCount2–83Words per passphrase
separatorup to 3 chars"-"String joining the words

Words are drawn uniformly at random from the EFF Short Word List using crypto.getRandomValues. The bundled list holds 1,294 words of three to five letters — the published EFF list with internal-hyphen entries removed, so a word can never be mistaken for the - separator.

Three words drawn from 1,294 is roughly 31 bits of entropy — comfortably above the 8-character Wi-Fi PSK floor — while staying memorable enough to read aloud. Increase wordCount if you need more: each extra word adds about 10.3 bits, so the 8-word maximum is roughly 83 bits.

With the defaults, a passphrase is 11 to 17 characters long (three words of three to five letters, joined by two separators) — always past the 8-character minimum, and short enough to type on a phone keypad.

{ passphrases: string[], wordListSize: number }

wordListSize reports the size of the bundled list — currently 1294. It is surfaced so the model can reason about entropy without hard-coding the size.

async () => {
const { passphrases } = await core.generate_passphrase({ count: 10 });
// ...then core.call({ method: 'POST', path: '/dpskPools/{guid}/dpsks', ... }) for each.
return { generated: passphrases.length, sample: passphrases.slice(0, 3) };
}

The defaults (count 1, wordCount 3, separator -) match the standalone cp-word-list enrollment webhook exactly, so passphrases minted here look the same as those generated during Cloudpath enrollment.