VaultBox: A Forward-Secure C++ Library for Replicated, Rateless Storage

VaultBox is a header-only C++ library for forward-secure, replicated, randomized, and rate-less storage and transmission of data. It builds on the Crypto++ library and is designed for highly adversarial channels where an attacker may eavesdrop on or delete messages.
Compiling
g++ -I/usr/local/include -L/usr/local/lib test.cpp lib.cpp -lcryptopp
Three levels of protection
- At rest: the VaultBox buffer is secured with Authenticated Encryption.
- In transit: data is protected with Falcon (fountain/rate-less) encoding.
- Hardware (optional): secure chips such as TPM/TEE and secure memory such as ECC-RAM or persistent memory can add an extra layer (hardware API support is not implemented in the library itself).
The secure data structure
The core is a fixed-size secure buffer (DS) of size T = k x n, holding k replicas of n messages. The sender transmits it every x minutes; if the receiver does not get it in that window, that itself signals an attack or crash. Replicas are stored at random locations from a PRNG, and the buffer is initialized with noise so that occupied and empty slots are indistinguishable. To send it, the sealed buffer is split into blocks, LT-encoded, and wrapped with Authenticated Encryption; the receiver collects enough symbols to regenerate and decrypt the buffer. This gives two encryption layers: one per message (inner) and one over the whole buffer (outer).
Components
- Integrity Checker: maintains a running hash of the buffer and raises an alert if the stored hash and the computed hash diverge.
- Encoder / Decoder: convert buffer messages to and from Falcon symbols without changing the transmission channel.
- Verifier: alerts on failed authenticated decryption, on sequence-number gaps (SequenceChecker), on mismatched replicas of the same sequence number when the replication factor is greater than one (IdentityChecker), and on failed re-verification of messages carried over from prior sessions.
Forward-secure key evolution
The outer-layer symbol key K_S is hashed forward each session, generating a nonce (via PRNG) and the inner-layer message key K_M via KeyGen(K_S). Each message derives its own encryption and HMAC keys, so compromising one session's keys does not expose earlier sessions:
For every session
K_S <- Hash(K_S)
Nonce <- PRNG(K_S)
K_M <- KeyGen(K_S)
For every message M
K_M <- Hash(K_M)
k_ENC, k_HMAC <- K_M {inner layer key}
M_AE <- AuthEnc(M, k_ENC, k_HMAC)
End For
k_ENC, k_HMAC <- K_S {outer layer key}
For every symbol S
S_AE <- AuthEnc(S, k_ENC, k_HMAC)
End For
End For
Links
- Source: github.com/devharsh/VaultBox
- License: GPL-3.0
If you use VaultBox, citation metadata is provided in the repository's CITATION.cff.
VaultBox is a header-only C++ library for forward-secure, replicated, and rateless storage and transmission. Forward security means that even if the current key is compromised, previously stored data stays protected, because keys are evolved over time and old ones are discarded.
The rateless, replicated design spreads data so it can be reconstructed from enough of the pieces, which adds resilience against loss. Together these properties target durable storage that also limits the damage of a key compromise.
Comments
Post a Comment