Add passphrase encryption module
PBKDF2-SHA256 -> AES-256-GCM via WebCrypto, with versioned blob header authenticated as GCM additional data. Tests cover round trip, wrong passphrase, tampering and malformed input. build.js bundles crypto.js into the single-file output. Closes #2 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
3
build.js
3
build.js
@@ -9,7 +9,8 @@ const read = (p) => readFileSync(join(root, 'src', p), 'utf8');
|
||||
// Function replacers avoid '$' pattern interpretation in replacement text.
|
||||
const out = read('index.html')
|
||||
.replace('/*__CSS__*/', () => read('style.css'))
|
||||
.replace('/*__JS__*/', () => read('app.js'))
|
||||
// Plain-script bundle: drop ES `export` so modules concatenate into one scope.
|
||||
.replace('/*__JS__*/', () => [read('crypto.js').replace(/^export /gm, ''), read('app.js')].join('\n'))
|
||||
.replace('/*__PAYLOAD__*/', () => '');
|
||||
|
||||
mkdirSync(join(root, 'dist'), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user