Overview
The Data Vault (DVault) is a binary block that contains large and sensitive data necessary for Proone’s operation. DVault serves two primary purposes:- Reduce executable size - By consolidating large data into a custom section rather than duplicating it in each architecture’s
.datasection - Mask sensitive data - Protect credentials and configuration from simple inspection tools like
stringsor core dumps
Structure
The DVault binary block has a specific layout:Data Types
DVault supports two data types (defined insrc/dvault.h:41-49):
PRNE_DATA_TYPE_CSTR- Null-terminated C string (UTF-8 encoded)PRNE_DATA_TYPE_BIN- Binary data
Masking Mechanism
DVault uses a simple but effective XOR-based masking scheme:Mask Generation
A 256-byte random array is generated at compile time and stored at the beginning of the DVault block. This mask has high entropy, making compression ineffective.Per-Entry Masking
Each entry has its own salt byte that offsets into the mask array:Masking Process
- Generate random salt byte for this entry
- Build entry:
[salt][type][length][data] - XOR bytes 1-N (everything except salt) with mask using salt offset
- Result has high entropy and resists compression
API Usage
Initialization
Retrieving Data
Security: Immediate Reset
Critical: Always callprne_dvault_reset() immediately after using sensitive data:
Entry Format
Each DVault entry follows this wire format:| Offset | Size | Field | Description |
|---|---|---|---|
| 0 | 1 | Salt | Random offset for mask |
| 1 | 1 | Type | PRNE_DATA_TYPE_CSTR or PRNE_DATA_TYPE_BIN |
| 2-3 | 2 | Length | Big-endian uint16, data length in bytes |
| 4+ | N | Data | The actual data (N = length) |
Design Trade-offs
Advantages
- Size optimization: Single copy of large data across all architectures
- Memory protection: Sensitive data masked except during use
- Simple implementation: XOR masking has minimal CPU overhead
- Analysis resistance: High entropy prevents pattern recognition
Limitations
- No compression: XOR masking creates high-entropy data that doesn’t compress
- Size limit: 64KB maximum per entry due to 16-bit length field
- Not cryptographically secure: XOR with known mask is trivially reversible if mask is found
DVault prioritizes obfuscation over cryptographic security. The goal is to resist casual inspection (strings, core dumps), not determined reverse engineering.
Build Tools
DVault binaries are generated usingproone-mkdvault during the build process:
Source Files
src/dvault.h:1- Header with API definitions and data typessrc/dvault.c:1- Implementation of masking and retrieval functionssrc/proone-mkdvault.c- Build tool for generating DVault binaries
