Repository navigation
Add Password Generator plugin - #120
Open
doctatortot wants to merge 1 commit into
Open
doctatortot wants to merge 1 commit into
doctatortot wants to merge 1 commit into
Conversation
Implements the plugin requested in hermes-hq#52: - Random passwords with configurable length and character-set toggles (lower/upper/digits/symbols), plus an option to exclude visually ambiguous characters (0/O, 1/l/I). - Word-based passphrases from a curated 1424-word list (no profanity, no easily-confused words), with configurable word count, separator, capitalization, and an optional trailing number. - API-key-style tokens with an optional prefix. - An entropy-based strength meter shared across all three modes. - Copy to clipboard with a configurable auto-clear timeout, which only clears the clipboard if it still holds what this plugin copied. All randomness goes through crypto.getRandomValues via rejection sampling — never Math.random — since this plugin exists specifically to produce secrets. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
doctatortot
force-pushed
the
plugin/password-generator
branch
from
September 28, 2026 11:56
b11693a to
7de9e58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #52. A utilities plugin that generates secrets in three modes:
0/O,1/l/I).sk_live_...).All three modes share an entropy-based strength meter, and the Copy button supports a configurable clipboard auto-clear timeout (Never/15s/30s/60s) — it only clears the clipboard if it still holds exactly what this plugin copied, so it won't clobber something else you copied in the meantime.
All randomness goes through
crypto.getRandomValuesvia rejection sampling, neverMath.random, since the whole point of this plugin is producing secrets.A bug this testing caught
My first version of the rejection-sampling helper only drew a single random byte (0–255), which works fine for small character sets but infinite-loops for any pool larger than 256 — exactly the 1424-word wordlist used by Passphrase mode. Running the generator logic directly (outside the UI) against a real assertion suite caught this before it shipped: switching to Passphrase mode would have hung. Fixed by sampling a 32-bit value instead, and re-verified with 20,000 draws confirming uniform coverage across all 1424 words (no modulo bias).
Permissions
clipboard.write— copy the generated secretclipboard.read— check the clipboard still holds our value before auto-clearing itTest plan
npx tsc --noEmit— cleannpm run build— builds todist/index.js(34.90 kB) via the standard IIFE template configgenerator.ts's functions directly (transpiled, outside the plugin sandbox) against real assertions: password length/charset/ambiguous-char exclusion over 200 samples, passphrase word-membership/format over 50 samples, API key prefix/no-prefix formatting, strength ordering, and a 20,000-draw distribution check on the wordlisttsc's type checking🤖 Generated with Claude Code