Skip to content

fix: bind EXPORT_VERSION to HKDF info string in key backup (v3.1)#73

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-hkdf-info-string-version-binding
Draft

fix: bind EXPORT_VERSION to HKDF info string in key backup (v3.1)#73
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-hkdf-info-string-version-binding

Conversation

Copy link
Copy Markdown

Copilot AI commented Jun 2, 2026

Using a static HKDF info string means a future version bump with a different cipher scheme would derive the same key from the same password+salt — enabling key reuse across incompatible formats.

Changes

  • EXPORT_VERSION bumped 3.03.1 to mark the boundary where version-binding takes effect
  • Export: info string now includes the version:
    // before
    HKDF.derive(passwordKey, hkdfSalt, 'QryptChat-KeyBackup-ChaCha20', 32)
    // after
    HKDF.derive(passwordKey, hkdfSalt, `QryptChat-KeyBackup-v${EXPORT_VERSION}-ChaCha20`, 32)
  • Import: version-aware info string selection preserves backward compatibility with existing v3.0 backups:
    const hkdfInfo = parsedData.version === '3.0'
        ? 'QryptChat-KeyBackup-ChaCha20'
        : `QryptChat-KeyBackup-v${parsedData.version}-ChaCha20`;

Copilot AI changed the title [WIP] Fix HKDF info string to include version binding for key export fix: bind EXPORT_VERSION to HKDF info string in key backup (v3.1) Jun 2, 2026
Copilot AI requested a review from ralyodio June 2, 2026 14:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LOW] HKDF info string in key export lacks version binding

2 participants