wilcocrypt 1.0.0 → 2.0.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 +674 -201
- package/README.md +89 -55
- package/dist/cli.js +4441 -0
- package/dist/cli.min.cjs +2 -0
- package/dist/cli.min.js +2 -0
- package/dist/wilcocrypt.js +987 -0
- package/dist/wilcocrypt.min.js +1 -0
- package/package.json +28 -11
- package/rollup.config.js +54 -0
- package/sea/sea-config.json +5 -0
- package/encryption.js +0 -103
- package/main.js +0 -55
- package/nokey.js +0 -2
- package/test/config.json +0 -3
- package/test/decrypt.js +0 -6
- package/test/decryptLog.js +0 -6
- package/test/encrypt.js +0 -4
- package/test/encrypted/main +0 -1
- package/test/test.js +0 -1
package/README.md
CHANGED
|
@@ -1,77 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WilcoCrypt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**WilcoCrypt** is a simple and secure file encryption tool for Node.js.
|
|
4
|
+
It offers both a clean programmatic API and a practical command-line interface (CLI) for everyday use.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
The library focuses on strong defaults, portability, and predictable behavior across environments
|
|
7
|
+
(including low-end devices such as Raspberry Pi and Android/Termux).
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
In config.json moet de even het begin van JSON code toevoegen, de rest word automatisch gedaan.
|
|
9
|
-
```json
|
|
10
|
-
{}
|
|
11
|
-
```
|
|
9
|
+
---
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- AES-256-GCM authenticated encryption
|
|
14
|
+
- Password-based key derivation using scrypt
|
|
15
|
+
- MessagePack + gzip for compact encrypted files
|
|
16
|
+
- Built-in versioning and compatibility checks
|
|
17
|
+
- Clear and consistent error handling
|
|
18
|
+
- Clean separation between public API and internal helpers
|
|
19
|
+
- Command-line interface (CLI) for quick file encryption and decryption
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install wilcocrypt
|
|
17
27
|
```
|
|
18
28
|
|
|
19
|
-
###
|
|
20
|
-
Hierin staat de code voor het encrypten.
|
|
21
|
-
```js
|
|
22
|
-
const wilcocrypt = require("wilcocrypt");
|
|
23
|
-
const path = require("path");
|
|
29
|
+
### CLI Installation
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g wilcocrypt
|
|
26
33
|
```
|
|
27
|
-
Dit zorgt ervoor dat het bestand config.json word genomen als keyFile, main.js als JavaScript bestand, en encrypted als de map waar het bestand inkomt.
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Usage (Node.js)
|
|
38
|
+
|
|
31
39
|
```js
|
|
32
|
-
|
|
33
|
-
const path = require("path");
|
|
40
|
+
import wilcocrypt from 'wilcocrypt';
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
// Encrypt a file
|
|
43
|
+
wilcocrypt.encryptFile('document.txt', 'myStrongPassword');
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
// Decrypt a file
|
|
46
|
+
const content = wilcocrypt.decryptFile('document.txt.enc', 'myStrongPassword');
|
|
47
|
+
console.log(content);
|
|
38
48
|
```
|
|
39
|
-
Hierin staat weer dat config.json word genomen als keyFile en encrypted als de map waar het bestand instaat.
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
Dan komt er een mapje encrypted met daarin iets zoals dit:
|
|
46
|
-
```
|
|
47
|
-
ec3d347f42dcb45872dbe11384511403442d24fe0c502e2070db8ca2fea0c3f9c2d1bb15c0f27a83ed128c545ee668f176d4c4c3ce78fe3c69f0979c80e9ee2e97533b2701b90cff18af9643441ccfde6b428c7746fd722ccf6b9290be12254b9a5d0bbbc121442d8a6077b8857c87788acfd00c0448e5e8edd28c093f1f24b016743aa13bbff1ecf0a6e7424307973d440f57cf3bc6b4770018c9e2effeaeb94b762975c526f44299d8734e1407ae994b27dabf6fed930ee0201e90812aa547b57cd75e718d96bb7915e2c1d37026b7bcec4c5c331a17b4f882f43f427ccf9b99a4ed51921bfdede2b40a493034e3016144bc1db0f93616e9bafcaf2e04623699d768ed6b099fc2a29820c39329de6e58e392c6ff43722b57f9bb3e006fbd0e4a5ba83ae7844b780dffd347115a070587def1a552ffbb3fa248a50d55a3e20b0632de552a83f995bf0697e963809d51d08c2cc3675d2d1e1427ac74279b40ebb5298576dec079b726e3ca1590c67119943ca3b265f3afe64df6acb1ddd5a285d8812bc1964c68a2c4fb69c9f0b4e4828ac7bd6778e5bac26da778aac5f5db727eb8da208cabad5f19f020125a71c6f1611f5e3e3add92e7b994c253eaf4becbb092309294952afae4e7bd2e16761b8d5f2ec1cafc5782ceaa0ee7cd1acd9cf7417a3a38f2ffc19f47c5c48dcecb240d83ad82fb16ea82633ac15a4c0af8aa614de5eaadbf550861c90aa2f1004957d96c3bf12c6ba3b766319a065bbf44b08e24576819249fa84b8583b4828d983338efa35f744fc75d9b3f96a23a552d655290cd0d3826cc24d883a39212c28addfcba95a0efcd5a8e14a56f08b17e5db749c063459a3e45d6c1ca89f86bc7d5fb5b6a0c745a27a918fc2169fdd9f6974d41f778a3078557d785d1b9bd0f40b890b1c21a7011f5ce8198b57603b219036400016c936a1b0e91a63037c7397d5d1a463a2ebf293c3217694c854a28d42cd3a08588470b2390a8df1d21f489cf68f279e8b45edf8f45d299ac6d50dc2f37139d17cba18ecb264783e1484b8e9bfa916820788371484f821a0a5464df34cbf95a6faab3bd4cfd128cc9acb57ef4f2893f96b324ee06968b199836797601d64c0670602cec99c561387399459114cf5c5a8556f7878538cbfddf95e2bfec6e3199120e8e8cde931a9816b86e3562185ab023e0fe2cd10f75685b03734f05380d9803c50bbe9bfc112ccfdb45e537e9b5e645536a0b6a5bf071722de3ef2522e0912b51c2cf5a1e268cd2207d242ce5797001d44482d0cc5931e84c7039674576f9d44b67739d1eaab7fd94e50cd191cc460f805cc27143834a37f76ccd65271ce2342f23c50806e509a2567982d008c5256bace9cb81b9f46e2b1c2d41bdb94b357227c3bc0e3f49eabd390d596cd1349a28d5a3c60e6e7ac65fdffabe797a6a4352f4ab67228f52c17dedd83a14f2faf2479757aac21818741c13323b27c12f18858ef2c3362ed730651ffdd64c166ffb53b8a2703d191b2160aaaf36aee571adc522cf148be4a7cb07eb58f3d702959c857e1b4fb9f80d8d616fbd98f1acb92a983bb480a43635b1ef6a47e471098974eb00babaee1127c0f3a4911b7d1f52d1
|
|
48
|
-
```
|
|
49
|
-
Als je uitvoert:
|
|
50
|
-
```shell
|
|
51
|
-
node decrypt.js
|
|
52
|
-
```
|
|
53
|
-
dan komt er:
|
|
54
|
-
```
|
|
55
|
-
Voorbeeld
|
|
56
|
-
```
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Internal helpers (optional)
|
|
57
53
|
|
|
58
|
-
|
|
54
|
+
Advanced users can access internal helpers via `wilcocrypt._`.
|
|
55
|
+
These APIs are considered internal and may change between versions.
|
|
59
56
|
|
|
60
|
-
Voor de mensen die het leuk vinden is er ook nog de `decryptLog` functie. Die is als volgt te gebruiken:
|
|
61
57
|
```js
|
|
62
|
-
const
|
|
63
|
-
const
|
|
58
|
+
const iv = Buffer.from('...');
|
|
59
|
+
const key = Buffer.from('...');
|
|
60
|
+
const encrypted = wilcocrypt._.encryptData(Buffer.from('Hello'), key, iv);
|
|
61
|
+
```
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
---
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
## CLI Usage
|
|
66
|
+
|
|
67
|
+
Once installed globally:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Encrypt a file
|
|
71
|
+
wilcocrypt -e document.txt
|
|
72
|
+
wilcocrypt --encrypt document.txt
|
|
73
|
+
|
|
74
|
+
# Decrypt a file
|
|
75
|
+
wilcocrypt -d document.txt.enc
|
|
76
|
+
wilcocrypt --decrypt document.txt.enc
|
|
77
|
+
|
|
78
|
+
# Internal: unpack raw encrypted envelope
|
|
79
|
+
wilcocrypt --unpack document.txt.enc
|
|
72
80
|
```
|
|
73
|
-
Dit is in princiepe zelfs in de webbrowser uit te voeren, dan krijg je in de console: `Voorbeeld`
|
|
74
81
|
|
|
75
|
-
|
|
82
|
+
The CLI will securely prompt for a password (input is masked).
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Version
|
|
87
|
+
|
|
88
|
+
- Current version: **2.0.0**
|
|
89
|
+
- Version 1.x is deprecated and should not be used
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
WilcoCrypt is released under the **GPL-3.0-only** license.
|
|
96
|
+
|
|
97
|
+
You are free to:
|
|
98
|
+
- Use the software for any purpose
|
|
99
|
+
- Study how it works and modify it
|
|
100
|
+
- Redistribute the software
|
|
101
|
+
- Distribute modified versions
|
|
102
|
+
|
|
103
|
+
Under the condition that:
|
|
104
|
+
- Any distributed derivative work is also licensed under GPL-3.0-only
|
|
105
|
+
- The source code remains available to users
|
|
106
|
+
|
|
107
|
+
This software is provided **without any warranty**.
|
|
108
|
+
Use it at your own risk.
|
|
76
109
|
|
|
77
|
-
|
|
110
|
+
For full license text, see:
|
|
111
|
+
https://www.gnu.org/licenses/gpl-3.0.html
|