@vaultkeepr/core 0.1.2 → 0.1.3
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/README.md +60 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @vaultkeepr/core
|
|
2
|
+
|
|
3
|
+
Vault cryptography for VaultKeepR: XChaCha20-Poly1305 AEAD encryption, Argon2id key derivation, ECIES wallet envelopes, TOTP, passkeys, BIP-39, password tooling, and import/export for 10+ password manager formats.
|
|
4
|
+
|
|
5
|
+
Zero-knowledge by design: the master password never leaves the user's device, and plaintext never crosses a network boundary.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @vaultkeepr/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import {
|
|
17
|
+
addEntry,
|
|
18
|
+
createEmptyVault,
|
|
19
|
+
decryptVault,
|
|
20
|
+
deriveKeyFromPasswordArgon2,
|
|
21
|
+
encryptVault,
|
|
22
|
+
generatePassword,
|
|
23
|
+
generateSaltArgon2,
|
|
24
|
+
serializeVault,
|
|
25
|
+
} from "@vaultkeepr/core";
|
|
26
|
+
|
|
27
|
+
// Build a vault
|
|
28
|
+
const vault = addEntry(createEmptyVault(), {
|
|
29
|
+
title: "GitHub",
|
|
30
|
+
url: "https://github.com",
|
|
31
|
+
username: "octocat",
|
|
32
|
+
password: generatePassword(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Encrypt locally — Argon2id (t=3, m=64 MiB, p=4) + XChaCha20-Poly1305
|
|
36
|
+
const salt = generateSaltArgon2();
|
|
37
|
+
const key = deriveKeyFromPasswordArgon2("correct horse battery staple", salt);
|
|
38
|
+
const encrypted = encryptVault(serializeVault(vault), key);
|
|
39
|
+
|
|
40
|
+
// Decrypt (the key is wiped after each use — re-derive it)
|
|
41
|
+
const plaintext = decryptVault(encrypted, deriveKeyFromPasswordArgon2("correct horse battery staple", salt));
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Other surfaces: TOTP (`getTOTPCode`, `parseTOTPUri`), importers (`importFromPgp`, `importVaultText`, LastPass, Keeper, Dashlane, Enpass, KeePass XML, RoboForm, Bitwarden/1Password exports), passkey/NFC/MRZ crypto, password health and entropy, BIP-39/EFF wordlists, three-way merge, pairing.
|
|
45
|
+
|
|
46
|
+
## Security notes
|
|
47
|
+
|
|
48
|
+
- Crypto primitives come from `@noble/ciphers`, `@noble/curves`, `@noble/hashes`.
|
|
49
|
+
- `encryptVault`/`decryptVault` wipe the master key after use by default (`wipeKeyAfterUse`).
|
|
50
|
+
- Vault integrity is enforced via an HMAC-SHA256 commitment — tampering throws.
|
|
51
|
+
|
|
52
|
+
## Related packages
|
|
53
|
+
|
|
54
|
+
- [`@vaultkeepr/sync`](https://www.npmjs.com/package/@vaultkeepr/sync) — CRDT synchronization
|
|
55
|
+
- [`@vaultkeepr/ipfs`](https://www.npmjs.com/package/@vaultkeepr/ipfs) — CID storage and gateway fetch
|
|
56
|
+
- [`@vaultkeepr/recovery`](https://www.npmjs.com/package/@vaultkeepr/recovery) — fragmented recovery
|
|
57
|
+
|
|
58
|
+
Repository: [VaultKeepR/vaultkeepr-public](https://github.com/VaultKeepR/vaultkeepr-public) · Site: [vaultkeepr.xyz](https://vaultkeepr.xyz) · Threat model: [`docs/THREAT_MODEL.md`](https://github.com/VaultKeepR/vaultkeepr-public/blob/main/docs/THREAT_MODEL.md)
|
|
59
|
+
|
|
60
|
+
MIT licensed.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaultkeepr/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "TypeScript vault crypto: XChaCha20-Poly1305, Argon2id, wallet ECIES envelopes, TOTP, imports — VaultKeepR SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/VaultKeepR/vaultkeepr-public.git",
|
|
8
8
|
"directory": "packages/core"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://
|
|
10
|
+
"homepage": "https://vaultkeepr.xyz",
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/VaultKeepR/vaultkeepr-public/issues"
|
|
13
13
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"ethers": "^6.13.0",
|
|
39
39
|
"fflate": "^0.8.3",
|
|
40
40
|
"viem": "^2.21.0",
|
|
41
|
-
"@vaultkeepr/logger": "0.1.
|
|
41
|
+
"@vaultkeepr/logger": "0.1.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@vitest/coverage-v8": "^4.1.11",
|