fix: upgrade encryption to AES-GCM, fix silent decrypt failures#214
Merged
Conversation
…, S2) Replace crypto-js (MD5-based KDF, unauthenticated AES-CBC) with the Web Crypto API using PBKDF2 (200k iterations, SHA-256) and AES-GCM. Boards encrypted with the old crypto-js format are detected by their OpenSSL prefix and continue to decrypt via the legacy path. Also fixes the silent-failure bug where decrypt() returned '?' on error — it now throws, with all callers updated to handle failures explicitly. Closes S1 and S2 from IMPROVEMENTS.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cy.readFile was picking up the previous run's file before the new download landed. Delete the file first so the assertion waits for a fresh write. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Stubs URL.createObjectURL to intercept the blob before it lands on disk, eliminating the stale-file race and the date-in-filename race. Cypress retries the wrap assertion until blob.text() resolves. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
$cards was empty when downloadCSV fired because Firestore hadn't delivered the cards yet. Gate on the card being visible first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Salted__prefix and continue to decrypt via a read-only legacy path; crypto-js is kept as a dependency only for this.decrypt()now throws on failure instead of silently returning'?'. All six call sites updated — components abort edits gracefully, CSV export falls back to'?'per field,checkBoardPasswordcatches and returnsfalse.IMPROVEMENTS.mdnow that all items (Q1–Q4, T1–T4, B1–B8, S1–S2) have been addressed.Test plan
Encryption.cy.jstests pass (create board with password, unlock, see plaintext)U2FsdGVkX1prefix in Firestore)🤖 Generated with Claude Code