Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sqlcipher/sqlcipher
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sqlcipher/sqlcipher
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: beta
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 9 commits
  • 37 files changed
  • 1 contributor

Commits on Sep 11, 2026

  1. Add VFS shim to replace Codec integration

    SQLCipher now uses sqlite3_vfs and sqlite3_file shims instead of a
    pager Codec hook. The VFS is registered at initialization time and allows
    SQLCipher to transparently intercept file I/O for encryption and decryption.
    
    This VFS implementation supports encryption of the main database,
    journal files, WAL files, and statement journals using
    dedicated read/write handlers that implement appropriate logic for each
    file type and the variety of special cases for each.
    
    This change includes a substantial refactoring and realignment with upstream code:
      - All uses of CODEC* macros are removed
      - Internal "codec" structs and functions have renamed and refactored
      - The family of key and rekey PRAGMAs are moved out of pragma.c
      - Status pragmas are relocated to VFS File Control so they are only invoked when
        the VFS is active
      - Many files that were previously modified or extended to support SQLCipher
        have been reverted to unmodified SQLite sources
      - Keying :memory: databases is now an explicit misuse
      - Significantly expanded test coverage
      - Requires compile time -DSQLITE_DIRECT_OVERFLOW_READ=0
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    cf64e12 View commit details
    Browse the repository at this point in the history
  2. Add AEAD encryption support using AES-256-GCM

    Authenticated Encryption with Associated Data (AEAD) is the new default. SQLCipher
    uses AES-256-GCM and per-page subkeys generated by a KBKDF (SP 800-108 counter mode
    KDF using AES-256-CMAC). This replaces the old approach that used AES-256-CBC + HMAC-SHA512.
    
    This adds AEAD and KBKDF functions to the SQLCipher provider interface which must be
    implemented in any custom cryptographic providers. Implementations have been added for
    OpenSSL and LibTomCrypt. An implementation has not been added for CommonCrypto because
    the library does not support GCM.
    
    If AEAD is not in use (i.e. explicitly disabled), SQLCipher will no longer perform an
    extra HMAC key derivationstep by default. Instead, the HMAC key is derived at the same time
    as the encryption key by getting extra bytes from PBKDF2. When using PBKDF2-HMAC-SHA512
    It is a beneficial optimization to eliminate the second, low-iteration PBKDF2 operation.
    
    The default AEAD mode is not transparently backwards-compatibile with previous
    SQLCipher v4 databases, however, the cipher_compatibility and cipher_migrate PRAGMAs
    allow opening old databases or migrating to the new settings respectively. Accordingly,
    all legacy modes are still supported for compatibility with older SQLCipher versions.
    
    The CommonCrypto provider is now deprecated and requires a special override define
    to compile.
    
    A reference database and expanded test coverage for new settings are included.
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    0529c36 View commit details
    Browse the repository at this point in the history
  3. Add rekey support for plaintext-to-encrypted and encrypted-to-plainte…

    …xt conversion
    
    In addition to the new features, error handling and test cases are singificantly
    expanded upon and improved.
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    6ecb5d8 View commit details
    Browse the repository at this point in the history
  4. Include SQLCipher at compile time by default (replaces SQLITE_HAS_COD…

    …EC macro w/ OMIT_SQLCIPHER)
    
    Previously, SQLCipher would only be enabled in the codebase if the SQLITE_HAS_CODEC
    macro was set at compile time. If that was not defined, then standard SQLite would be
    built instead. This was confusing. Now, SQLCipher will be enabled by default, and
    it will only be omitted from the build if OMIT_SQLCIPHER is defined. The latter
    can be used when full tests, fuzzing, or behavior comparisons against stock
    SQLite are required.
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    e680213 View commit details
    Browse the repository at this point in the history
  5. Remove support for all historically deprecated PRAGMA settings

    - PRAGMA cipher_store_pass
    - PRAGMA cipher
    - PRAGMA fast_kdf_iter
    - PRAGMA cipher_hmac_pgno
    - PRAGMA cipher_hmac_salt_mask
    - PRAGMA rekey_cipher
    - PRAGMA rekey_kfd_iter
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    4ae56eb View commit details
    Browse the repository at this point in the history
  6. Increase default page size to 8192 bytes

    The previous 4096 byte page size used in SQLCipher 4 was based on
    the SQLite default adopted in 2016. Updating to a larger page
    size provides more balanced performance for SQLCipher especially
    with mixed workloads on modern flash storage, and reduces the
    relative overhead for encryption and decryption operations.
    
    Benchmarking shows that 8192 bytes is a relative sweet spot that
    performs very well for large/bulk operations without imposing a
    significant penalty on smaller operations.
    
    The 8K default page size is not transparently backwards-compatible
    with previous v4 databases but the cipher_compatibility and
    cipher_migrate operations allow opening old databases or migrating
    to the new setting.
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    79aaf71 View commit details
    Browse the repository at this point in the history
  7. Shield rollback journal and WAL checksum values

    SQLite calculates and stores checksums over page content in rollback
    journal and WAL files. Because SQLCipher is now a VFS instead of
    a CODEC hook, the checksums are calculated on the plaintext page. This
    commit introduces shielding of the checksums before they are written
    to the rollback journal or WAL.
    sjlombardo committed Sep 11, 2026
    Configuration menu
    Copy the full SHA
    070fa06 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ac89110 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    02051d3 View commit details
    Browse the repository at this point in the history
Loading