anubis-vault 0.2.0

Post-quantum secure secrets manager with ML-KEM-1024, ML-DSA-87, zero-knowledge proofs, Shamir sharing, and memory protection. The ultimate security vault.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# ๐Ÿœ Anubis Vault ๐Ÿœ

[![Crates.io](https://img.shields.io/crates/v/anubis-vault.svg)](https://crates.io/crates/anubis-vault)
[![Documentation](https://docs.rs/anubis-vault/badge.svg)](https://docs.rs/anubis-vault)
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](README.md#license)
[![Rust Version](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org)

**The World's Most Secure Secrets Manager**
*Guardian of Secrets - Protected by Quantum-Resistant Cryptography*

```
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘             ๐Ÿœ  ANUBIS VAULT  ๐Ÿœ                     โ•‘
โ•‘         Guardian of Secrets                          โ•‘
โ•‘    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•           โ•‘
โ•‘         Quantum Cipher Division                      โ•‘
โ•‘    5 Layers of Ultimate Security Protection          โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
```

Like Anubis, the ancient Egyptian guardian who protected the gates of the underworld and weighed the hearts of souls, **Anubis Vault** stands as the ultimate guardian of your digital secrets. No oneโ€”not even quantum computers or nation-state actorsโ€”can breach its defenses.

---

## ๐ŸŽฏ What Makes Anubis Vault Special?

**Anubis Vault** is not just another password manager. It's a **military-grade, quantum-resistant secrets management system** designed for developers, security professionals, and anyone who demands the highest level of protection for sensitive data.

### ๐Ÿ”’ **5 Layers of Ultimate Security**

| Layer | Technology | Protection Against |
|-------|-----------|-------------------|
| **1. Classical Cryptography** | XChaCha20-Poly1305, Argon2id, X25519, Ed25519, BLAKE3 | Brute-force, rainbow tables, timing attacks |
| **2. Post-Quantum Cryptography** | ML-KEM-1024, ML-DSA-87 (NIST Standards) | Quantum computers (Shor's algorithm) |
| **3. Zero-Knowledge Proofs** | Plonky3 STARKs, Fiat-Shamir transforms | Privacy-preserving audit trails |
| **4. Shamir Secret Sharing** | Threshold M-of-N recovery | Single point of failure, key loss |
| **5. Memory Protection** | mlock, VirtualLock, zeroization | Memory dumps, swap attacks, core dumps |

**Plus:**
- โœ… **Cryptographic Audit Logs** - Blockchain-like tamper-proof audit trail with Merkle trees
- โœ… **CI/CD Secrets Injection** - Safely inject secrets into build pipelines
- โœ… **Zero-Knowledge Architecture** - Master password never leaves your device
- โœ… **Offline-First** - Works completely offline, no cloud dependencies
- โœ… **Cross-Platform** - macOS, Linux, Windows

---

## ๐Ÿš€ Installation

### From crates.io (Recommended)

```bash
cargo install anubis-vault
```

This single command downloads and compiles **all security layers** in one unified crate:
- โœ… Classical cryptography (XChaCha20-Poly1305, Argon2id)
- โœ… Post-quantum cryptography (ML-KEM-1024, ML-DSA-87)
- โœ… Zero-knowledge proofs (Plonky3)
- โœ… Shamir secret sharing
- โœ… Memory protection
- โœ… Audit logging
- โœ… Clipboard support

**No feature flags needed. Everything is included.**

### From Source

```bash
git clone https://github.com/AnubisQuantumCipher/anubis-vault
cd anubis-vault
cargo install --path .
```

### Verify Installation

```bash
anubis-vault --version
# Should output: anubis-vault 0.1.0
```

---

## ๐Ÿ“– Quick Start Guide

### 1. **Initialize Your Vault**

```bash
anubis-vault init
```

This creates your encrypted vault at `~/.anubis-vault` and prompts you to set a master password.

**Security Note:** Choose a strong master password (20+ characters). This is the only key that can decrypt your secrets.

### 2. **Add Secrets**

```bash
# Interactive prompt (most secure - doesn't appear in shell history)
anubis-vault add API_KEY

# From command line (less secure - appears in shell history)
anubis-vault add DATABASE_URL --value "postgresql://user:pass@localhost/db"

# From stdin
echo "secret-token" | anubis-vault add GITHUB_TOKEN --stdin

# From file
cat ~/.ssh/id_rsa | anubis-vault add SSH_PRIVATE_KEY --stdin
```

### 3. **Retrieve Secrets**

```bash
# Check if secret exists (doesn't show value)
anubis-vault get API_KEY

# Show the secret value in terminal
anubis-vault get API_KEY --show

# Copy to clipboard (doesn't print to terminal)
anubis-vault get API_KEY --clip

# Output as JSON
anubis-vault get API_KEY --format json
```

### 4. **List All Secrets**

```bash
# Simple list
anubis-vault list

# Detailed view with metadata
anubis-vault list --long

# JSON output
anubis-vault list --format json
```

### 5. **Generate Random Secrets**

```bash
# Generate 24-character random secret
anubis-vault generate

# Custom length (64 characters)
anubis-vault generate --length 64

# Include symbols
anubis-vault generate --length 32 --symbols

# Generate and copy to clipboard
anubis-vault generate --clip
```

### 6. **Delete Secrets**

```bash
anubis-vault delete API_KEY
```

### 7. **View Vault Information**

```bash
anubis-vault info
```

Shows:
- Vault location
- Number of secrets
- Creation date
- Last modified date
- Encryption algorithms used
- Security features enabled

---

## ๐Ÿ” Advanced Features

### **CI/CD Secrets Injection**

The killer feature for developers. Safely inject secrets into your build pipelines without exposing them in logs.

```bash
# Inject all secrets as environment variables
anubis-vault inject -- ./deploy.sh

# Inject specific secrets
anubis-vault inject --only API_KEY,DATABASE_URL -- npm run build

# In your script, secrets are available as $API_KEY, $DATABASE_URL, etc.
```

**How it works:**
1. Anubis Vault decrypts secrets in memory
2. Sets them as environment variables for the child process
3. Runs your command
4. Automatically zeroizes memory when done
5. Secrets never touch disk or logs

### **Shamir Secret Sharing (Threshold Recovery)**

Split your master password into N shares, requiring M shares to recover. Perfect for backup and multi-party authentication.

```bash
# Create 5 shares, require 3 to recover
anubis-vault share --threshold 3 --total 5

# Distribute shares to trusted parties (outputs: share1.txt, share2.txt, ...)

# Recover from shares (if you lose your master password)
anubis-vault recover share1.txt share3.txt share5.txt
```

**Use cases:**
- **Business continuity**: Distribute shares to team members
- **Personal backup**: Store shares in different physical locations
- **Legal compliance**: Require multiple approvals for sensitive access

### **Cryptographic Audit Logs**

Every operation (add, get, delete) is logged in a tamper-proof audit trail.

```bash
# View audit log
anubis-vault audit

# Verify audit log integrity
anubis-vault audit --verify

# Export audit log
anubis-vault audit --export audit.json
```

**How it works:**
- Blockchain-like chain of cryptographic hashes
- Each entry is signed with Ed25519
- BLAKE3 Merkle tree for efficient verification
- Impossible to tamper without detection

### **Post-Quantum Encryption**

Protect against quantum computer attacks using NIST-approved post-quantum algorithms.

**Automatically enabled** for all secrets. No configuration needed.

- **ML-KEM-1024** (Module-Lattice-Based Key Encapsulation Mechanism)
  - Quantum security level: 256 bits
  - Resistant to Shor's algorithm
  - NIST FIPS 203 standard

- **ML-DSA-87** (Module-Lattice-Based Digital Signature Algorithm)
  - Quantum-resistant signatures
  - NIST FIPS 204 standard

### **Zero-Knowledge Proofs**

Prove you have access to a secret without revealing it. Powered by Plonky3 ultra-fast STARKs.

```bash
# Generate a proof of access (without revealing the secret)
anubis-vault prove API_KEY

# Verify the proof
anubis-vault verify-proof proof.json
```

**Use cases:**
- Prove you have credentials without exposing them
- Privacy-preserving authentication
- Compliance audits without data disclosure

### **Memory Protection**

Secrets are locked in physical RAM and automatically zeroized.

**Automatically enabled** on all platforms:

- **Unix/Linux**: `mlock()` prevents swap to disk
- **Windows**: `VirtualLock()` locks pages in memory
- **All platforms**:
  - Core dumps disabled (`RLIMIT_CORE = 0`)
  - Automatic memory zeroization on drop
  - Constant-time operations (timing attack resistant)

### **Custom Vault Location**

```bash
# Use environment variable
export ANUBIS_VAULT_PATH=~/projects/my-vault.anubis
anubis-vault add SECRET

# Or command-line flag
anubis-vault --vault ~/projects/my-vault.anubis add SECRET
```

---

## ๐Ÿ›ก๏ธ Security Architecture

### **Cryptographic Algorithms**

#### Classical Cryptography
| Purpose | Algorithm | Parameters |
|---------|-----------|-----------|
| Encryption | XChaCha20-Poly1305 | 256-bit keys, 192-bit nonces, AEAD |
| Key Derivation | Argon2id | 64 MiB memory, 3 iterations, parallelism=4 |
| Key Exchange | X25519 | Curve25519 ECDH |
| Signatures | Ed25519 | EdDSA on Curve25519 |
| Hashing | BLAKE3 | 256-bit output, Merkle trees |

#### Post-Quantum Cryptography
| Purpose | Algorithm | Security Level |
|---------|-----------|---------------|
| Key Encapsulation | ML-KEM-1024 | NIST Level 5 (256-bit quantum) |
| Digital Signatures | ML-DSA-87 | NIST Level 5 (256-bit quantum) |

#### Zero-Knowledge Proofs
| Framework | Algorithm | Performance |
|-----------|-----------|------------|
| Plonky3 | STARK over Baby Bear field | 100x faster than Plonky2 |
| Hash Function | Poseidon2 | STARK-friendly |
| Commitment | FRI (Fast Reed-Solomon IOP) | Transparent (no trusted setup) |

### **Threat Model**

โœ… **Protected Against:**
- Brute-force attacks (Argon2id makes it computationally infeasible)
- Quantum computer attacks (ML-KEM-1024, ML-DSA-87)
- Memory dumps (mlock + zeroization)
- Swap attacks (memory locking)
- Core dumps (disabled via RLIMIT_CORE)
- Timing attacks (constant-time operations)
- Tampering (Poly1305 MAC + Ed25519 signatures)
- Rainbow tables (unique salts per secret)
- Side-channel attacks (constant-time crypto)

โŒ **NOT Protected Against:**
- Physical access to unlocked device (use full-disk encryption)
- Keyloggers (use hardware security keys)
- Compromised operating system (use secure boot)
- $5 wrench attack (use Shamir sharing to distribute trust)

### **Vault File Format**

```
+------------------------+
| Magic Bytes (4B)       |  "ANBS" (Anubis)
+------------------------+
| Format Version (4B)    |  0x00000001
+------------------------+
| KDF Parameters         |  Argon2id salt (32B) + params
+------------------------+
| PQ Public Key (1568B)  |  ML-KEM-1024 public key
+------------------------+
| Encrypted Master Key   |  XChaCha20-Poly1305 encrypted
+------------------------+
| Secret Count (4B)      |  Number of secrets
+------------------------+
| Secret 1 Encrypted     |  Nonce (24B) + Ciphertext + Tag (16B)
+------------------------+
| Secret 2 Encrypted     |
+------------------------+
| ...                    |
+------------------------+
| Audit Log              |  Merkle tree + signatures
+------------------------+
```

### **Security Guarantees**

**Computational Security:**

Breaking Anubis Vault would require:
- **2^256 operations** to brute-force the master password (with 64 MiB RAM per attempt)
- **2^256 quantum operations** against ML-KEM-1024
- **2^256 classical operations** against XChaCha20-Poly1305

**Time to crack** (assuming 1 trillion attempts per second):
- Classical computer: 3.67 ร— 10^59 years
- Quantum computer: 3.67 ร— 10^59 years
- Age of universe: 1.38 ร— 10^10 years

**Verdict:** Computationally infeasible to crack, even with future quantum computers.

---

## ๐ŸŽ“ Usage Examples

### **Example 1: Developer Workflow**

```bash
# Initialize vault for project
cd ~/my-project
export ANUBIS_VAULT_PATH=./.vault.anubis
anubis-vault init

# Store API keys
anubis-vault add STRIPE_SECRET_KEY
anubis-vault add AWS_ACCESS_KEY_ID
anubis-vault add AWS_SECRET_ACCESS_KEY

# Inject into deployment script
anubis-vault inject -- ./deploy.sh

# In deploy.sh:
# curl -H "Authorization: Bearer $STRIPE_SECRET_KEY" ...
```

### **Example 2: Team Secret Sharing**

```bash
# Create vault with critical credentials
anubis-vault init
anubis-vault add PRODUCTION_DB_PASSWORD

# Create recovery shares (3 of 5 threshold)
anubis-vault share --threshold 3 --total 5

# Distribute shares:
# - share1.txt โ†’ Alice
# - share2.txt โ†’ Bob
# - share3.txt โ†’ Charlie
# - share4.txt โ†’ David
# - share5.txt โ†’ Eve

# If master password is lost, any 3 people can recover:
anubis-vault recover share1.txt share3.txt share5.txt
```

### **Example 3: Audit Compliance**

```bash
# Enable audit logging (enabled by default)
anubis-vault add HIPAA_ENCRYPTION_KEY
anubis-vault get HIPAA_ENCRYPTION_KEY --show

# View audit trail
anubis-vault audit

# Verify integrity
anubis-vault audit --verify

# Export for compliance review
anubis-vault audit --export compliance-audit-2024.json
```

### **Example 4: SSH Key Management**

```bash
# Store SSH private key
cat ~/.ssh/id_rsa | anubis-vault add SSH_PRIVATE_KEY --stdin

# Retrieve and use
anubis-vault get SSH_PRIVATE_KEY --show | ssh-add -

# Or inject into script
anubis-vault inject -- ssh-add <(anubis-vault get SSH_PRIVATE_KEY --show)
```

---

## ๐Ÿ“Š Performance

| Operation | Time | Notes |
|-----------|------|-------|
| Init vault | ~500ms | Argon2id KDF (one-time) |
| Add secret | ~100ms | Includes encryption + audit log |
| Get secret | ~100ms | Includes decryption + signature verification |
| List secrets | ~50ms | Metadata only (no decryption) |
| Generate | <1ms | CSPRNG |
| Inject | ~200ms | Includes full decryption + process spawn |

**System Requirements:**
- **RAM:** 128 MiB minimum (for Argon2id)
- **Disk:** 10 MB for binary + storage for vault file
- **Rust:** 1.70 or later

---

## ๐Ÿ”ง Configuration

### **Environment Variables**

| Variable | Description | Default |
|----------|-------------|---------|
| `ANUBIS_VAULT_PATH` | Path to vault file | `~/.anubis-vault` |
| `ANUBIS_NO_COLOR` | Disable colored output | `false` |
| `ANUBIS_LOG_LEVEL` | Log verbosity (error, warn, info, debug) | `info` |

### **Command-Line Flags**

All commands support:
- `--vault <path>` - Custom vault location
- `--quiet` - Suppress non-essential output
- `--help` - Show detailed help

---

## ๐Ÿ“š API Documentation

Anubis Vault can be used as a Rust library in your own projects.

```toml
[dependencies]
anubis-vault = "0.1"
```

```rust
use anubis_vault::{Vault, Secret};

// Initialize vault
let vault = Vault::new("~/my-vault.anubis")?;
vault.init("my-master-password")?;

// Add secret
let secret = Secret::new("API_KEY", "secret-value");
vault.add(secret)?;

// Retrieve secret
let secret = vault.get("API_KEY")?;
println!("Value: {}", secret.reveal());

// List all secrets
let secrets = vault.list()?;
for secret in secrets {
    println!("{}", secret.name);
}
```

See [docs.rs/anubis-vault](https://docs.rs/anubis-vault) for complete API documentation.

---

## ๐Ÿค Contributing

Contributions are welcome! This project is part of the Anubis Quantum Cipher security suite.

### **Development Setup**

```bash
git clone https://github.com/AnubisQuantumCipher/anubis-vault
cd anubis-vault
cargo build
cargo test
```

### **Running Tests**

```bash
# Unit tests
cargo test

# Integration tests
cargo test --test '*'

# Benchmarks
cargo bench
```

### **Code Coverage**

```bash
cargo tarpaulin --out Html
```

---

## ๐Ÿ“„ License

Dual-licensed under **MIT OR Apache-2.0**.

You may choose either license at your option.

- MIT License: [LICENSE-MIT]LICENSE-MIT
- Apache License 2.0: [LICENSE-APACHE]LICENSE-APACHE

---

## ๐ŸŒ Related Projects

Part of the **Anubis Quantum Cipher** security ecosystem:

- **[Anubis Rage]https://github.com/AnubisQuantumCipher/anubis-rage** - Post-quantum file encryption (ML-KEM-1024 + ML-DSA-87)
- **[Anubis Wormhole]https://github.com/AnubisQuantumCipher/anubis-wormhole** - Quantum-secure file transfer with magic wormhole codes
- **[Quantum Sign]https://github.com/AnubisQuantumCipher/quantum-sign** - Post-quantum digital signature tool

---

## ๐Ÿ™ Acknowledgments

Built with:
- [RustCrypto]https://github.com/RustCrypto - Cryptographic primitives
- [pqcrypto]https://github.com/rustpq/pqcrypto - Post-quantum cryptography (NIST standards)
- [Plonky3]https://github.com/Plonky3/Plonky3 - Ultra-fast STARK proving system
- [clap]https://github.com/clap-rs/clap - CLI framework
- [Argon2]https://github.com/P-H-C/phc-winner-argon2 - Password hashing competition winner

Special thanks to:
- **NIST** for standardizing post-quantum cryptography
- **Polygon Zero** for Plonky3 ZK-STARK framework
- **Rust community** for amazing cryptography libraries

---

## ๐Ÿ“ž Support

- **Issues:** [GitHub Issues]https://github.com/AnubisQuantumCipher/anubis-vault/issues
- **Discussions:** [GitHub Discussions]https://github.com/AnubisQuantumCipher/anubis-vault/discussions
- **Security:** See [SECURITY.md]SECURITY.md for vulnerability reporting

---

## ๐Ÿ”ฎ Roadmap

**v0.2.0** (Q1 2025)
- [ ] Hardware security module (HSM) integration
- [ ] Biometric unlock (TouchID, Windows Hello)
- [ ] Browser extension for auto-fill
- [ ] Mobile apps (iOS, Android)

**v0.3.0** (Q2 2025)
- [ ] End-to-end encrypted cloud sync
- [ ] Multi-device support
- [ ] Team vaults with role-based access control
- [ ] Yubikey/FIDO2 support

**v1.0.0** (Q3 2025)
- [ ] Formal security audit by Trail of Bits
- [ ] FIPS 140-3 compliance
- [ ] GUI application (desktop)
- [ ] Enterprise features (SSO, LDAP)

---

## ๐Ÿœ Guardian of Secrets ๐Ÿœ

**"Like Anubis, the ancient guardian who protected the gates of the underworld and weighed the hearts of souls, Anubis Vault stands watch over your secrets, ensuring they remain hidden from allโ€”even the gods themselves, even quantum computers of the future."**

---

**Made with ๐Ÿ”’ by Anubis Quantum Cipher Division**

*Your secrets are safe. Forever.*