@kryklin/darkstar-crypt-node 1.0.0 → 1.0.1
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 +70 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @kryklin/darkstar-crypt-node
|
|
2
|
+
|
|
3
|
+
> **Darkstar V2 Encryption Protocol - Node.js Implementation**
|
|
4
|
+
|
|
5
|
+
A high-performance, standalone implementation of the Darkstar V2 security protocol for Node.js. Designed for web backends and desktop applications requiring defense-in-depth for sensitive mnemonic assets.
|
|
6
|
+
|
|
7
|
+
## 🛡️ Security Features
|
|
8
|
+
|
|
9
|
+
- **Dynamic Obfuscation Pool**: 12-stage transformation pipeline seeded by password and data.
|
|
10
|
+
- **AES-256-CBC**: Encapsulated with 600,000 PBKDF2 iterations.
|
|
11
|
+
- **Stateless Reversal**: Requires a "Reverse Key" produced during encryption for decryption.
|
|
12
|
+
- **Native Performance**: Leverages the Node.js `crypto` module.
|
|
13
|
+
|
|
14
|
+
## 🚀 Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @kryklin/darkstar-crypt-node
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 💻 Usage
|
|
21
|
+
|
|
22
|
+
### Library Usage
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
import { DarkstarCrypt } from '@kryklin/darkstar-crypt-node';
|
|
26
|
+
|
|
27
|
+
const crypt = new DarkstarCrypt();
|
|
28
|
+
|
|
29
|
+
// Encrypt
|
|
30
|
+
const { encryptedData, reverseKey } = await crypt.encrypt("my secret phrase", "password123");
|
|
31
|
+
console.log('Encrypted:', encryptedData);
|
|
32
|
+
console.log('Reverse Key:', reverseKey);
|
|
33
|
+
|
|
34
|
+
// Decrypt
|
|
35
|
+
const decrypted = await crypt.decrypt(encryptedData, "password123", reverseKey);
|
|
36
|
+
console.log('Decrypted:', decrypted);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### CLI Usage
|
|
40
|
+
|
|
41
|
+
The package includes a CLI tool that can be run via `npx`.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Encrypt
|
|
45
|
+
npx darkstar-crypt encrypt "secret message" "password"
|
|
46
|
+
|
|
47
|
+
# Decrypt
|
|
48
|
+
npx darkstar-crypt decrypt '{"v":2,"data":"..."}' "password" "REVERSE_KEY_B64"
|
|
49
|
+
|
|
50
|
+
# Run internal tests
|
|
51
|
+
npx darkstar-crypt test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 📜 Data Format
|
|
55
|
+
|
|
56
|
+
Standard output is a JSON-encapsulated object:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"v": 2,
|
|
61
|
+
"data": "SALT(32)IV(32)CIPHERTEXT(B64)"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> [!IMPORTANT]
|
|
66
|
+
> The **Reverse Key** is essential for decryption. It must be stored securely alongside the encrypted data.
|
|
67
|
+
|
|
68
|
+
## ⚖️ License
|
|
69
|
+
|
|
70
|
+
MIT © Victor Kane
|