Repository navigation
Key Management
V14 uses a layered key hierarchy designed to separate user credentials, the package root key, metadata keys, filename keys, and per-file keys.
Password ------------------+
|
Argon2id13
|
Pattern -------------------+
|
credentialWrapKey
|
v
+---------------------+
| primary key slot |
| AEAD-wrapped root |
+---------------------+
|
v
packageRootKey
|
+-------------+-------------+
| | |
v v v
manifestKey filenameKey fileRootKey
|
+---------+---------+
| | |
v v v
fileKey fileKey fileKey
The recovery path is parallel:
random recoveryKey
|
v
recovery key slot
|
v
same packageRootKey
The application requires strong password and pattern values.
The current validator requires:
- at least 12 characters
- lowercase letters
- uppercase letters
- numeric characters
- special characters
- estimated entropy of at least 60 bits according to the application's heuristic
The pattern requires:
- at least 12 characters
- valid UTF-8
- no null byte
- no single-character repetition of the entire pattern
- at least 5 distinct characters
- estimated entropy of at least 50 bits according to the application's heuristic
These checks are policy controls, not replacements for a strong password manager or proper secret handling.
The user password and pattern are processed separately through Argon2id13. They use different purpose-derived salts even though the package header carries one 32-byte package salt.
Intermediate derived keys are zeroized after they are combined into the credential wrapping key.
A random package root key creates a clean boundary:
- credentials are used to unlock the package key;
- the package key becomes the parent for all package-specific cryptographic subkeys;
- individual credentials do not become the long-lived file encryption key.
This is a more modular design than repeatedly treating a password-derived value as the direct content key.
The optional recovery key is an independently generated 256-bit secret.
The project encodes it for transport as unpadded base64url. The reader expects a 43-character URL-safe form and decodes it back to exactly 32 bytes.
The recovery key should be:
- stored offline or in another secure secret manager;
- kept separate from the package;
- excluded from logs and analytics;
- excluded from source control;
- treated like a full package credential.
The package itself does not contain a recoverable copy of the recovery key.
The primary key slot fails AEAD authentication if the derived credential wrapping key is incorrect.
The API also rate-limits package opening attempts. Failed operations use generic error messages so the caller does not receive detailed information about which internal validation stage failed.
The implementation calls sodium_memzero() for sensitive values such as:
- password-derived intermediate keys;
- package root key;
- manifest key;
- filename key;
- file root key;
- per-file keys;
- recovery key bytes;
- user-supplied password/pattern buffers in controller paths where appropriate.
Zeroization is best understood as a defense-in-depth measure. High-level language runtimes cannot provide an absolute guarantee that no copies ever existed.
Project names and account usernames can be protected with a server-side secret called SPK_NAME_PEPPER.
The application supports two modes:
-
Explicit secret: provide
SPK_NAME_PEPPERthrough controlled server configuration. -
Local bootstrap fallback: when it is absent, the application creates a persistent random 256-bit secret under
storage/secrets/name-pepper.binwith restrictive permissions.
The fallback exists to make ordinary Apache/XAMPP setups functional. Controlled production secret management is preferred.
Application account passwords are stored as PHP PASSWORD_ARGON2ID password hashes, separate from the V14 package encryption KDF.
The account verifier also performs a dummy Argon2id verification when the username does not exist to reduce timing differences associated with username enumeration.
This is distinct from V14 package encryption. Application login credentials and package decryption credentials are different concepts.
Generate
-> derive/wrap
-> use only for intended purpose
-> zeroize sensitive intermediates
-> retain only the non-secret metadata required by the package format
The key-management design is intentionally explicit because confusing authentication credentials, package encryption keys, and recovery credentials is a common source of security defects.
Secure Package V14 · SECURE-PKG-V14 · Version 14.1.0 · MIT License · Author: ElmanCod110
This Wiki describes the implementation currently documented by the repository. Security-sensitive behavior should be verified against the active source tree before production deployment.
Start
V14 Engine
Security
Integration
Operations
- Storage and Data Lifecycle
- Deployment
- Testing and Validation
- Release and Supply Chain
- Migration V13 to V14
Contributing