urchin-vault 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +217 -0
- package/dist/cli.js +1206 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.js +111 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/config.js +53 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/files.js +406 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/keys.js +159 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/lib/cifer.js +190 -0
- package/dist/lib/cifer.js.map +1 -0
- package/dist/lib/storage.js +108 -0
- package/dist/lib/storage.js.map +1 -0
- package/dist/lib/store.js +49 -0
- package/dist/lib/store.js.map +1 -0
- package/dist/lib/ui.js +250 -0
- package/dist/lib/ui.js.map +1 -0
- package/package.json +65 -0
- package/urchin.png +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Capsule Corp / CIFER Security
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="urchin.png" alt="Urchin" width="280" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Urchin</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Quantum-encrypted file vault for the command line</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
Encrypt files with <a href="https://sdk.cifer-security.com/docs/">CIFER</a> (ML-KEM-768 + AES-256-GCM) and store them on <a href="https://storacha.network">Filecoin/IPFS</a> or locally.
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="#installation">Installation</a> •
|
|
17
|
+
<a href="#quick-start">Quick Start</a> •
|
|
18
|
+
<a href="#how-it-works">How It Works</a> •
|
|
19
|
+
<a href="#commands">Commands</a> •
|
|
20
|
+
<a href="#storage-providers">Providers</a> •
|
|
21
|
+
<a href="#architecture">Architecture</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Why Urchin?
|
|
27
|
+
|
|
28
|
+
Current encryption standards (RSA, ECC) will be broken by quantum computers. Urchin uses **ML-KEM-768** — a NIST-standardized post-quantum key encapsulation mechanism — combined with **AES-256-GCM** symmetric encryption, delivered through the [CIFER SDK](https://sdk.cifer-security.com/docs/).
|
|
29
|
+
|
|
30
|
+
Your files are encrypted locally before they ever leave your machine, then stored on decentralized storage (Filecoin/IPFS via Storacha) or kept locally. Nobody — not the storage provider, not CIFER, not us — can read your files.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Install globally
|
|
36
|
+
npm install -g urchin
|
|
37
|
+
|
|
38
|
+
# Or clone and link
|
|
39
|
+
git clone https://github.com/capsule-corp-ternoa/urchin.git
|
|
40
|
+
cd urchin
|
|
41
|
+
npm install
|
|
42
|
+
npm run build
|
|
43
|
+
npm link
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Requirements:** Node.js >= 20
|
|
47
|
+
|
|
48
|
+
**Optional:** For decentralized storage, install the [Storacha CLI](https://docs.storacha.network/):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install -g @storacha/cli
|
|
52
|
+
storacha login you@email.com
|
|
53
|
+
storacha space create my-vault
|
|
54
|
+
storacha space provision --customer you@email.com
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# 1. Create a CIFER account
|
|
61
|
+
urchin register
|
|
62
|
+
|
|
63
|
+
# 2. Create an encryption key (ML-KEM-768 key pair)
|
|
64
|
+
urchin key create mykey
|
|
65
|
+
|
|
66
|
+
# 3. Encrypt and upload a file
|
|
67
|
+
urchin push secret-doc.pdf -k mykey
|
|
68
|
+
|
|
69
|
+
# 4. Download and decrypt
|
|
70
|
+
urchin pull secret-doc.pdf
|
|
71
|
+
|
|
72
|
+
# 5. Or just type 'urchin' for the interactive dashboard
|
|
73
|
+
urchin
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Interactive Mode
|
|
77
|
+
|
|
78
|
+
Run `urchin` with no arguments to get a fully interactive experience:
|
|
79
|
+
|
|
80
|
+
- **Visual file browser** — navigate your filesystem with arrow keys to pick files
|
|
81
|
+
- **Key selector** — choose which encryption key to use
|
|
82
|
+
- **Provider picker** — select where to store (Storacha, local, etc.)
|
|
83
|
+
- **File browser** — browse your vault, filter by key or provider, view details
|
|
84
|
+
- **Open in browser** — view encrypted files on the IPFS gateway
|
|
85
|
+
- **Smart save** — pick destination folder when pulling files (Desktop, Downloads, or browse)
|
|
86
|
+
|
|
87
|
+
## How It Works
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Urchin Encryption Pipeline
|
|
91
|
+
|
|
92
|
+
┌──────────┐ ┌─────────────────────┐ ┌──────────────────┐
|
|
93
|
+
│ │ │ CIFER Blackbox │ │ Storage │
|
|
94
|
+
│ Your │────▶│ │────▶│ │
|
|
95
|
+
│ File │ │ 1. Generate random │ │ Storacha (IPFS) │
|
|
96
|
+
│ │ │ AES-256 key │ │ Local disk │
|
|
97
|
+
└──────────┘ │ 2. Wrap key with │ │ (more coming) │
|
|
98
|
+
│ ML-KEM-768 │ │ │
|
|
99
|
+
│ 3. Encrypt file │ └──────────────────┘
|
|
100
|
+
│ with AES-256-GCM│
|
|
101
|
+
└─────────────────────┘
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
1. A random **AES-256** key is generated for each file
|
|
105
|
+
2. That key is wrapped using **ML-KEM-768** (post-quantum) via the CIFER payload API
|
|
106
|
+
3. The file is encrypted locally with **AES-256-GCM** using the random key
|
|
107
|
+
4. The encrypted bundle (wrapped key + encrypted data + IV + auth tag) is uploaded to storage
|
|
108
|
+
5. Only someone with access to the CIFER secret can unwrap the AES key and decrypt
|
|
109
|
+
|
|
110
|
+
**The file never leaves your machine unencrypted.**
|
|
111
|
+
|
|
112
|
+
## Commands
|
|
113
|
+
|
|
114
|
+
### Files
|
|
115
|
+
|
|
116
|
+
| Command | Description |
|
|
117
|
+
|---------|-------------|
|
|
118
|
+
| `urchin push <file>` | Encrypt and upload a file |
|
|
119
|
+
| `urchin pull <file>` | Download and decrypt a file |
|
|
120
|
+
| `urchin ls` | List all files in vault |
|
|
121
|
+
| `urchin file rm <file>` | Remove file from vault index |
|
|
122
|
+
| `urchin file providers` | List available storage providers |
|
|
123
|
+
|
|
124
|
+
### Keys
|
|
125
|
+
|
|
126
|
+
| Command | Description |
|
|
127
|
+
|---------|-------------|
|
|
128
|
+
| `urchin key create <name>` | Create a new ML-KEM-768 key pair |
|
|
129
|
+
| `urchin key ls` | List all encryption keys |
|
|
130
|
+
| `urchin key delete <name>` | Delete a key from local index |
|
|
131
|
+
|
|
132
|
+
### Account
|
|
133
|
+
|
|
134
|
+
| Command | Description |
|
|
135
|
+
|---------|-------------|
|
|
136
|
+
| `urchin register` | Create a new CIFER web2 account |
|
|
137
|
+
| `urchin login` | Log in to your CIFER account |
|
|
138
|
+
| `urchin logout` | Log out and clear session |
|
|
139
|
+
| `urchin whoami` | Show current session info |
|
|
140
|
+
|
|
141
|
+
### Config
|
|
142
|
+
|
|
143
|
+
| Command | Description |
|
|
144
|
+
|---------|-------------|
|
|
145
|
+
| `urchin config show` | Show current configuration |
|
|
146
|
+
| `urchin config set <key> <value>` | Update a setting |
|
|
147
|
+
|
|
148
|
+
**Options on push/pull:**
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
urchin push document.pdf -k mykey -p storacha
|
|
152
|
+
urchin pull document.pdf -o ~/Desktop/
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Storage Providers
|
|
156
|
+
|
|
157
|
+
Urchin supports pluggable storage backends. Currently available:
|
|
158
|
+
|
|
159
|
+
| Provider | Description | Status |
|
|
160
|
+
|----------|-------------|--------|
|
|
161
|
+
| **storacha** | Filecoin + IPFS via [Storacha](https://storacha.network) | ✅ Default |
|
|
162
|
+
| **local** | Local encrypted storage (`~/.cifer-vault/encrypted/`) | ✅ Available |
|
|
163
|
+
|
|
164
|
+
Set default provider:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
urchin config set defaultProvider local
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Architecture
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
src/
|
|
174
|
+
├── cli.ts # Entry point — interactive dashboard & menus
|
|
175
|
+
├── commands/
|
|
176
|
+
│ ├── auth.ts # Login, register, logout, whoami
|
|
177
|
+
│ ├── config.ts # Config show/set
|
|
178
|
+
│ ├── files.ts # Push, pull, list, rm, providers
|
|
179
|
+
│ └── keys.ts # Key create, list, delete
|
|
180
|
+
└── lib/
|
|
181
|
+
├── cifer.ts # CIFER SDK wrapper — encryption/decryption
|
|
182
|
+
├── storage.ts # Storage provider abstraction (Storacha, local)
|
|
183
|
+
├── store.ts # Local JSON store (~/.cifer-vault/data.json)
|
|
184
|
+
└── ui.ts # Terminal UI — colors, tables, gradients
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Key design decisions:**
|
|
188
|
+
|
|
189
|
+
- **Hybrid encryption** — CIFER wraps a random AES key with ML-KEM-768, then AES-256-GCM encrypts the actual file. This avoids size limits on the blackbox API.
|
|
190
|
+
- **Provider abstraction** — Storage backends implement a simple interface (`upload`, `download`, `check`, `getUrl`). Adding S3, IPFS pinning services, or other backends is straightforward.
|
|
191
|
+
- **Local-first** — Your vault index, keys, and session live in `~/.cifer-vault/`. No cloud database. You own your data.
|
|
192
|
+
- **Dual auth** — Web2 (email + Ed25519 sessions) and Web3 (wallet signing) are both supported at the SDK level.
|
|
193
|
+
|
|
194
|
+
## Tech Stack
|
|
195
|
+
|
|
196
|
+
- **[CIFER SDK](https://sdk.cifer-security.com/docs/)** — ML-KEM-768 post-quantum encryption
|
|
197
|
+
- **[Storacha](https://storacha.network)** — Filecoin/IPFS decentralized storage
|
|
198
|
+
- **[Commander.js](https://github.com/tj/commander.js)** — CLI framework
|
|
199
|
+
- **[Inquirer.js](https://github.com/SBoudrias/Inquirer.js)** — Interactive prompts
|
|
200
|
+
- **[inquirer-file-selector](https://github.com/br14n-sol/inquirer-file-selector)** — Visual file browser
|
|
201
|
+
- **TypeScript** — Full type safety
|
|
202
|
+
- **chalk / ora / gradient-string / cli-table3** — Terminal UI
|
|
203
|
+
|
|
204
|
+
## Development
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
git clone https://github.com/capsule-corp-ternoa/urchin.git
|
|
208
|
+
cd urchin
|
|
209
|
+
npm install
|
|
210
|
+
npm run dev # Watch mode
|
|
211
|
+
npm run build # One-time build
|
|
212
|
+
npm link # Install globally for testing
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
[MIT](LICENSE) — Capsule Corp / CIFER Security
|