SQLCipher Encrypted Database Expert

Implement SQLCipher encrypted SQLite databases with secure key derivation and re-keying.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/Probably-Group/Dev-AID --skill sqlcipher-encrypted-database-expert-probably-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: SQLCipher Encrypted Database Expert
Source: https://github.com/Probably-Group/Dev-AID/tree/main/.dev-aid/skills/expert/sqlcipher
Command: npx skills add https://github.com/Probably-Group/Dev-AID --skill sqlcipher-encrypted-database-expert-probably-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common SQLCipher security and correctness failures by guiding you to set up encrypted SQLite databases with safe key management, strong key derivation, secure querying, and reliable migration and re-keying.

Core Features & Use Cases

  • Key management & secure key derivation: Shows how to avoid hard-coded keys, derive strong encryption keys (e.g., PBKDF2 with high iteration counts), and source keys from secure providers like OS keychains.
  • Encryption correctness & verification: Ensures encryption is actually active by validating database access after applying the key and configuring cipher settings.
  • Re-keying, migration, and safe SQL execution: Provides patterns for rotating keys via PRAGMA rekey, migrating from plain SQLite by export/import, and using parameterized queries to prevent SQL injection.
  • Use Case: When adding at-rest encryption to an existing app that currently uses unencrypted SQLite, use this Skill to migrate data into a SQLCipher database, verify decryption correctness, and implement periodic key rotation without data loss.

Quick Start

Use the SQLCipher skill to generate a secure implementation plan and code patterns for encrypting a new database at 'data.db' using a key retrieved from your OS keychain and applying PRAGMA key, kdf_iter, and cipher settings before any other database operations.

Frequently Asked Questions about SQLCipher Encrypted Database Expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate an existing SQLite database to an encrypted SQLCipher database?

Migrating to a SQLCipher encrypted database involves using an export and import workflow to safely transfer data from plain SQLite, applying a secure encryption key, and verifying decryption correctness to prevent data loss.

What is the safest way to source a database encryption key for SQLCipher?

The safest way to source a SQLCipher database encryption key is retrieving it from secure OS keychains, avoiding hard-coded keys by deriving strong encryption through high KDF iteration thresholds before database initialization.

How does PRAGMA rekey work for rotating encryption keys in SQLCipher?

PRAGMA rekey works for rotating SQLCipher encryption keys by applying a new key to an already encrypted database, requiring secure sourcing for the new key and post-key verification to ensure operational re-keying completes without data loss.

Can I use parameterized queries to prevent SQL injection in SQLCipher databases?

Yes, you can and should use parameterized queries to prevent SQL injection in SQLCipher databases, ensuring SQL injection resistance remains intact even when executing operations under encryption with active cipher settings.

Why does SQLCipher database access fail after applying the encryption key?

SQLCipher database access fails after applying the encryption key if you do not configure cipher settings and validate database access immediately after, as encryption correctness requires post-key verification before any other database operations.