From b62ca1099ff996e333015142cb712687737d4637 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 17 Aug 2026 08:12:34 -0700 Subject: The seed takes dice: an optional entropy field folds open on the generate step, hashed with the device's own randomness so it can only strengthen the phrase — and the forget option now says all data, which is what it takes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/app.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/app.js') diff --git a/src/app.js b/src/app.js index d4d13b8..63b638b 100644 --- a/src/app.js +++ b/src/app.js @@ -770,12 +770,28 @@ function createPane() { 'div', { class: 'col' }, h('p', { class: 'muted' }, t('genIntro')), + // BYO randomness for the seed — folded away so the common path stays + // one button. Whatever is typed here is hashed together with the + // device's own randomness (see newMnemonic), never used alone. + h('button', { + class: 'linklike small', style: 'align-self:flex-start', + onClick: () => { ui.ownEntropyOpen = !ui.ownEntropyOpen; render(); }, + }, (ui.ownEntropyOpen ? '▾ ' : '▸ ') + t('entropyToggle')), + ui.ownEntropyOpen + ? h('div', { class: 'col gap6' }, + h('p', { class: 'small muted', style: 'margin:0' }, t('entropyHint')), + h('textarea', { + rows: '2', style: 'font-family:var(--sans)', placeholder: t('entropyPlaceholder'), + autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false', + value: ui.ownEntropy || '', onInput: (e) => (ui.ownEntropy = e.target.value), + })) + : null, h( 'button', { class: 'btn-primary btn-block', onClick: () => { - ui.draftMnemonic = newMnemonic(); + ui.draftMnemonic = newMnemonic(128, (ui.ownEntropy || '').trim()); render(); }, }, @@ -804,7 +820,7 @@ function createPane() { { class: 'btn-ghost btn-sm', onClick: () => { - ui.draftMnemonic = newMnemonic(); + ui.draftMnemonic = newMnemonic(128, (ui.ownEntropy || '').trim()); render(); }, }, -- cgit v1.2.3