feat(clipboard): add encrypted backup and restore - #396
Draft
xcv58 wants to merge 7 commits into
Draft
Conversation
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.
Adds encrypted Clipboard Backup under Clipboard → Local Data, with separate descriptive rows for backup, restore, and local rollback recovery. Users choose the archive or save location before entering a password. New backups require at least 12 characters and offer passphrase guidance; existing archives with shorter multibyte passwords remain readable. Saved Clips and Snippets are selected by default, while History requires explicit opt-in with its count, size, and privacy context. Portable
.mactoolsclipboardarchives remain separate from Preferences Backup and readable per-item Export.Restore authenticates and stages the archive before previewing a default merge or a precisely scoped replacement. Replacement requires confirmation before changing local data; cancelling preserves the preview, and completed operations show only Done. Conflicting content receives a new ID, conflicting snippet keywords are disabled, and conflict and missing-file reports remain available after restoration. Replacement creates an encrypted local rollback snapshot and updates both persistent tables in one SQLite transaction.
The versioned format uses a fresh archive key, AES-256-GCM records, PBKDF2-HMAC-SHA256 key wrapping with bounded parameters, and an encrypted terminal manifest binding counts, scope, ordering, and digests. Processing runs one bounded record at a time off the main actor and re-encrypts data with the destination key. The design/security review and local verification guide are included in docs/.
Validation:
Closes #394.