You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d4bbdc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(crypto): sign-in never replaces a published key; qc keys publish (0.16.1, qc 0.12.0) (#342)
Anthony (qc TUI): "[Encrypted message - decryption failed]".
Cause: on 2026-10-27 02:07 UTC a browser signed in as chovy with empty key
storage. postQuantumEncryption.initialize() generated a fresh keypair, and
keySyncService.autoSyncOnLogin saw "local key differs from database" and
published it over the account key (behaviour added in 11ced5a for rotation).
Every message sent after that was encrypted to a key only that one browser
holds, so qc and every other device failed. No reset happened (the key backup
from 10-06 is untouched, /api/keys/reset never called). qc 0.11.0 changed no
crypto code.
- needsKeySync syncs only when the account has NO published key. A different
key is reported (publishedKeyStatus 'differs', 'qrypt:key-mismatch' event),
never replaced.
- EncryptionWarning: "This device has different keys from your account" with
Restore my keys (first) or a confirmed "Use this device's keys". "Generate new
keys" now publishes explicitly (it relied on the sign-in sync).
- qc keys [publish]: check whether this terminal holds the account key, and put
it back (confirm or --yes). The TUI mismatch notice points at it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: packages/qryptchat/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@profullstack/qryptchat",
3
-
"version": "0.11.0",
3
+
"version": "0.12.0",
4
4
"description": "qc: qrypt.chat in your terminal. A full-screen end-to-end encrypted chat client (ML-KEM-1024), plus a scriptable CLI and an MCP server.",
show or set your public profile (an empty value clears it);
37
39
--openprofile prints it as OpenProfile.md
@@ -205,6 +207,29 @@ export async function main(argv, { version = '0.0.0' } = {}) {
205
207
}
206
208
return;
207
209
}
210
+
case'keys': {
211
+
constc=awaitclient(flags);
212
+
conststatus=awaitc.keyCheck();
213
+
if(rest[0]!=='publish'){
214
+
if(flags.json)returnjson({keys: status});
215
+
if(status==='ok')returnout(ok("This terminal's keys are your account's keys."));
216
+
if(status==='mismatch')returnout(warn("Your account publishes a different key, so messages sent to you since then won't decrypt here. If older messages read fine in qc read, run qc keys publish."));
217
+
returnout(info("Could not compare keys (no key on file, or the check failed)."));
218
+
}
219
+
if(status==='ok')returnout(ok('Already published: nothing to do.'));
220
+
// Everyone encrypts to the published key: replacing it is a deliberate act.
221
+
if(!flags.yes){
222
+
if(!process.stdin.isTTY)thrownewError('qc keys publish replaces the key everyone encrypts to. Add --yes to confirm.');
constanswer=awaitrl.question("Publish this terminal's key? Devices holding the other key will stop decrypting new messages until they restore your keys. [y/N] ");
226
+
rl.close();
227
+
if(!/^y(es)?$/i.test(answer.trim()))returnout(info('Left the published key alone.'));
returnout(ok("Published. New messages are encrypted to this terminal's key again; other devices on the other key should restore from Settings > Keys."));
232
+
}
208
233
case'logout':
209
234
clearSession();
210
235
returnout(ok('Signed out. This terminal no longer holds your keys.'));
Copy file name to clipboardExpand all lines: src/cli/tui.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -309,7 +309,7 @@ function saveRecent(list) {
309
309
}
310
310
311
311
/** Run the full-screen client until Ctrl+C. */
312
-
constKEY_MISMATCH="Keys don't match your account, so messages can't decrypt. Run qc login and approve from a browser that can read your chats.";
312
+
constKEY_MISMATCH="Keys don't match your account, so new messages can't decrypt. If your history reads here, run qc keys publish; else qc login from a browser that reads your chats.";
"Make this device's keys your account's keys?\n\nEveryone will encrypt new messages to this device's key. Your other devices (and qc) will stop reading new messages until they restore these keys, and this device still won't read your past messages. Restoring your keys here is almost always the better choice."
0 commit comments