sqlcipher

SQLCipher is a fork of SQLite3 that provides database encryption. It can be used with Prosody 13.0.0.

There is no Lua binding for SQLCipher, but since it is compatible with the SQLite3 ABI, it can be enabled by loading it via LD_PRELOAD in Prosodys environment:

LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libsqlcipher.so.1"

In the Prosody config, the database encryption key is provided as in the sql.password field:

sql = {
    driver = "SQLite3";
    database = "encrypted.db";
    password = "database encryption key";
}

Securing the database encryption key is left as an exercise.