Skip to content

feat: use raw SQLCipher keys for new user databases [WPB-27001]#4282

Open
MohamadJaara wants to merge 1 commit into
mo/sqlcipher-durable-key-storagefrom
mo/sqlcipher-raw-user-v2
Open

feat: use raw SQLCipher keys for new user databases [WPB-27001]#4282
MohamadJaara wants to merge 1 commit into
mo/sqlcipher-durable-key-storagefrom
mo/sqlcipher-raw-user-v2

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve V1 password-derived SQLCipher keys for existing user databases
  • generate fresh 32-byte V2 keys for newly created user databases
  • encode V2 keys using SQLCipher's raw-key x'<hex>' representation, avoiding PBKDF2 on database open
  • version key material through distinct aliases and cover selection/formatting with unit and Android device tests

Stack

  1. Durable database-key storage infrastructure
  2. This PR: raw SQLCipher V2 keys for new user databases
  3. Eager global database migration to a fresh raw V2 key

This PR intentionally does not migrate existing user databases.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit b89575d. ± Comparison against base commit a3a70b2.

♻️ This comment has been updated with latest results.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.41860% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (mo/sqlcipher-durable-key-storage@a3a70b2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...otlin/com/wire/kalium/logic/util/SecurityHelper.kt 74.41% 6 Missing and 5 partials ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##             mo/sqlcipher-durable-key-storage    #4282   +/-   ##
===================================================================
  Coverage                                    ?   61.24%           
  Complexity                                  ?     4012           
===================================================================
  Files                                       ?     2161           
  Lines                                       ?    69437           
  Branches                                    ?     6895           
===================================================================
  Hits                                        ?    42530           
  Misses                                      ?    24139           
  Partials                                    ?     2768           
Files with missing lines Coverage Δ
...otlin/com/wire/kalium/logic/util/SecurityHelper.kt 85.00% <74.41%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3a70b2...b89575d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MohamadJaara MohamadJaara changed the title Use raw SQLCipher keys for new user databases feat: use raw SQLCipher keys for new user databases [WPB-27001] Jul 10, 2026
@MohamadJaara MohamadJaara marked this pull request as ready for review July 10, 2026 08:28
@MohamadJaara MohamadJaara changed the title feat: use raw SQLCipher keys for new user databases [WPB-27001] feat: use raw SQLCipher keys for new user databases Jul 10, 2026
@MohamadJaara MohamadJaara changed the title feat: use raw SQLCipher keys for new user databases feat: use raw SQLCipher keys for new user databases [WPB-27001] Jul 10, 2026
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.

3 participants