diff --git a/Cargo.lock b/Cargo.lock index b82b665..8437f92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2937,7 +2937,7 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "writui" -version = "0.19.0" +version = "0.20.0" dependencies = [ "anyhow", "arboard", diff --git a/Cargo.toml b/Cargo.toml index ad7283d..13572d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "writui" -version = "0.19.0" +version = "0.20.0" edition = "2024" description = "A terminal writing app. No nonsense. Markdown. Local. Encrypted." license = "MIT" diff --git a/README.md b/README.md index 24af518..25f2f90 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,13 @@ fingerprint to the Mac turns it off until you next unlock with the password. Your vault's key, sealed so that only this Mac's Secure Enclave can open it after a fingerprint, is kept in `~/.config/writui/touch-id/`. +To change the password, open Settings and choose "Change password": type +your current password, then the new one twice. writui re-encrypts the +vault with the new password, keeping a backup of it until the vault has +reopened with the new password and passed its checks; if anything goes +wrong, the old password keeps working. Touch ID is set up again for the +new password on its own. + - **Posts** are listed with the most recently changed first. Open one with Enter or a click, start a new one with `n` (or Enter: "New" is highlighted when the list opens). The list's shortcuts are single keys, diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 2533f9d..6e09fc3 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -785,3 +785,39 @@ copied in the meantime. The trade-off: "select, Cmd+C, then type over the selection" loses the copy (Cmd+X is the way to do that). Non-text clipboard contents (an image) can't be remembered, so selecting text replaces them. Tests use a per-thread fake clipboard rather than the real one. + +## Changing the password: rekey in place, checked end to end + +`Vault::change_password` checks the current password (Argon2 with the +file's salt must give the open vault's key), makes a new random salt and +the new password's key, takes a fingerprint (SHA-256 over the schema +version and every row of every table), backs the file up next to itself +(`writui.db.password-