DuckLake supports an encrypted mode.
In this mode, Parquet data and delete files are encrypted using Parquet encryption.
In order to use this mode, the ENCRYPTED flag must be passed when initializing the DuckLake catalog:
ATTACH 'ducklake:encrypted.ducklake'
(DATA_PATH 'untrusted_location/', ENCRYPTED);
If DuckDB reports that only a read-only crypto module is loaded, load httpfs before writing encrypted files:
LOAD httpfs;
When enabled, all Parquet files that are written as part of DuckLake operations are automatically encrypted.
The encryption keys for each file are automatically generated by the system when the files are written.
New encryption keys are automatically generated for each write operation.
Files produced by the same write can share a key.
The keys are 256-bit and are generated using a cryptographically secure random number generator provided by the httpfs extension.
The generated keys are stored in the catalog, in the encryption_key field of the ducklake_data_file and ducklake_delete_file tables.
When data is read from the encrypted files, the keys are read from the catalog server and automatically used to decrypt the files. This allows encrypted DuckLake databases to be interacted with in exactly the same manner as unencrypted databases.
The encryption mode is persisted in the catalog, so subsequent attachments can omit ENCRYPTED.
Explicitly requesting an encryption mode that differs from the existing catalog is rejected.
Experimental Puffin deletion-vector files are written without encryption.