| id | encryption |
|---|---|
| title | Encryption and Key Rotation |
ENCRYPTION_MASTER_KEYcomes exclusively from the environment and is never stored.- Every user gets a Data Encryption Key (DEK), encrypted with the master key
(
server/encryption/user_keys.js). - Every file gets its own File Encryption Key (FEK), encrypted with the owner's DEK
(
file_key_wrappedondocuments). - All encryption uses AES-256-GCM (
server/encryption/encryption_service.js,server/encryption/stream_crypto.jsfor streaming with large files).
The server refuses to start if encryption is enabled but no valid master key is configured
(assertMasterKeyAvailableAtStartup).
neoarchive encryption rotate re-wraps every user's DEK under the current ENCRYPTION_KEY_VERSION -
without re-encrypting files themselves. Older key versions remain available for decrypting existing files
as long as ENCRYPTION_MASTER_KEY_V<n> is set.
Uploads and downloads are encrypted/decrypted chunk by chunk (stream_crypto.js) - large files are never
fully loaded into memory, and no permanent unencrypted intermediate files are created.