Skip to content

spt-vault

Quantum-resistant password vault with AES-256-GCM encryption and redb storage

Overview

spt-vault provides a secure password management system using AES-256-GCM authenticated encryption with Argon2id key derivation (64MB memory, 3 iterations) and redb-backed crash-safe persistent storage. It supports categorized secret organization, hardware key attestation with trust tiers, and automatic zeroization of sensitive data on drop. A pq feature flag is reserved for future ML-KEM/ML-DSA integration.

Key Features

  • AES-256-GCM encryption -- authenticated encryption for all stored secrets
  • Argon2id KDF -- memory-hard password-based key derivation (64MB, 3 iterations)
  • Redb storage -- persistent, crash-safe secret storage with category organization
  • Hardware attestation -- SecureKeyStore with trust tiers (SE/TPM/StrongBox/TEE/software)
  • Memory safety -- SensitiveString and VaultKeyPair with automatic zeroization on drop
  • PQ-ready -- pq feature flag for future post-quantum integration

Dependencies

No internal SPT crate dependencies. Uses aes-gcm for encryption, argon2 for KDF, redb for storage, zeroize for memory safety.

Usage

rust
use spt_vault::{Vault, VaultError};

let mut vault = Vault::create("my.vault", "master_password")?;
vault.add_secret("email/work", "user@example.com", Some("password123"))?;
let secret = vault.get_secret("email/work")?;

API Reference

Core Types

TypeDescription
VaultMain vault struct -- create, open, add/get/list secrets
VaultCryptoAES-256-GCM encryption/decryption operations
VaultKeyPairEncryption key pair with zeroize-on-drop
SecretEntryA stored secret with username, password, metadata
SecretMetadataTimestamps, category, and notes for a secret
SensitiveStringZeroize-on-drop string wrapper
SecureKeyStoreHardware-backed key storage with attestation
TrustTierHardware trust level (SE, TPM, StrongBox, TEE, Software)
KeyAlgorithmSupported key algorithms
VaultErrorCrate error type

Feature Flags

FeatureDefaultDescription
storageyesRedb-backed persistent storage
pqnoReserved for future ML-KEM/ML-DSA integration

Released under the MIT License.