@alessiofrittoli/crypto-cipher 1.0.0 → 1.1.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/README.md +24 -26
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ pnpm i @alessiofrittoli/crypto-cipher
|
|
|
89
89
|
|
|
90
90
|
#### Constants
|
|
91
91
|
|
|
92
|
-
##### `SALT_LENGTH`
|
|
92
|
+
##### `Cipher.SALT_LENGTH`
|
|
93
93
|
|
|
94
94
|
Defines the minimum, maximum, and default lengths for salt.
|
|
95
95
|
|
|
@@ -106,7 +106,7 @@ Defines the minimum, maximum, and default lengths for salt.
|
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
-
##### `IV_LENGTH`
|
|
109
|
+
##### `Cipher.IV_LENGTH`
|
|
110
110
|
|
|
111
111
|
Defines the minimum, maximum, and default lengths for initialization vectors (IV).
|
|
112
112
|
|
|
@@ -123,7 +123,7 @@ Defines the minimum, maximum, and default lengths for initialization vectors (IV
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
##### `AUTH_TAG_LENGTH`
|
|
126
|
+
##### `Cipher.AUTH_TAG_LENGTH`
|
|
127
127
|
|
|
128
128
|
Defines the minimum, maximum, and default lengths for authentication tags.
|
|
129
129
|
|
|
@@ -140,7 +140,7 @@ Defines the minimum, maximum, and default lengths for authentication tags.
|
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
|
143
|
-
##### `AAD_LENGTH`
|
|
143
|
+
##### `Cipher.AAD_LENGTH`
|
|
144
144
|
|
|
145
145
|
Defines the minimum, maximum, and default lengths for additional authenticated data (AAD).
|
|
146
146
|
|
|
@@ -157,23 +157,23 @@ Defines the minimum, maximum, and default lengths for additional authenticated d
|
|
|
157
157
|
|
|
158
158
|
---
|
|
159
159
|
|
|
160
|
-
##### `DEFAULT_ALGORITHM`
|
|
160
|
+
##### `Cipher.DEFAULT_ALGORITHM`
|
|
161
161
|
|
|
162
162
|
Specifies default AES algorithms for buffer and stream operations.
|
|
163
163
|
|
|
164
164
|
<details>
|
|
165
165
|
<summary>Properties</summary>
|
|
166
166
|
|
|
167
|
-
| Operation | Algorithm |
|
|
168
|
-
|
|
169
|
-
| `buffer` | `aes-256-gcm` |
|
|
170
|
-
| `stream` | `aes-256-cbc` |
|
|
167
|
+
| Operation | Algorithm | Description |
|
|
168
|
+
|------------|--------------|-------------|
|
|
169
|
+
| `buffer` | `aes-256-gcm` | Default algorithm used for buffer data encryption/decryption |
|
|
170
|
+
| `stream` | `aes-256-cbc` | Default algorithm used for stream encryption/decryption |
|
|
171
171
|
|
|
172
172
|
</details>
|
|
173
173
|
|
|
174
174
|
---
|
|
175
175
|
|
|
176
|
-
##### `ALGORITHMS`
|
|
176
|
+
##### `Cipher.ALGORITHMS`
|
|
177
177
|
|
|
178
178
|
Supported AES algorithms:
|
|
179
179
|
|
|
@@ -308,7 +308,7 @@ Type: `Promise<void>`
|
|
|
308
308
|
---
|
|
309
309
|
|
|
310
310
|
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
|
|
311
|
-
- See [`Cph.Stream.Symmetric.EncryptOptions`](#cphstreamsymmetricencryptoptions) for more informations about
|
|
311
|
+
- See [`Cph.Stream.Symmetric.EncryptOptions`](#cphstreamsymmetricencryptoptions) for more informations about encryption options.
|
|
312
312
|
- See [In-memory data stream encryption/decryption](#in-memory-data-stream-encryptiondecryption) examples.
|
|
313
313
|
- See [File based data stream encryption/decryption](#file-based-data-stream-encryptiondecryption) examples.
|
|
314
314
|
|
|
@@ -344,7 +344,7 @@ Type: `Promise<void>`
|
|
|
344
344
|
---
|
|
345
345
|
|
|
346
346
|
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
|
|
347
|
-
- See [`Cph.Stream.Symmetric.DecryptOptions`](#cphstreamsymmetricdecryptoptions) for more informations about
|
|
347
|
+
- See [`Cph.Stream.Symmetric.DecryptOptions`](#cphstreamsymmetricdecryptoptions) for more informations about decryption options.
|
|
348
348
|
- See [In-memory data stream encryption/decryption](#in-memory-data-stream-encryptiondecryption) examples.
|
|
349
349
|
- See [File based data stream encryption/decryption](#file-based-data-stream-encryptiondecryption) examples.
|
|
350
350
|
|
|
@@ -381,7 +381,7 @@ Type: `Promise<void>`
|
|
|
381
381
|
---
|
|
382
382
|
|
|
383
383
|
- See [`CoerceToUint8ArrayInput`](#coercetouint8arrayinput) for more informations about supported input data types.
|
|
384
|
-
- See [`Cph.Stream.Hybrid.EncryptOptions`](#cphstreamhybridencryptoptions) for more informations about
|
|
384
|
+
- See [`Cph.Stream.Hybrid.EncryptOptions`](#cphstreamhybridencryptoptions) for more informations about encryption options.
|
|
385
385
|
- See [In-memory data stream with hybrid encryption/decryption](#in-memory-data-stream-with-hybrid-encryptiondecryption) examples.
|
|
386
386
|
- See [File based data stream with hybrid encryption/decryption](#file-based-data-stream-with-hybrid-encryptiondecryption) examples.
|
|
387
387
|
|
|
@@ -432,13 +432,13 @@ This module supports different input data types and it uses the [`coerceToUint8A
|
|
|
432
432
|
|
|
433
433
|
---
|
|
434
434
|
|
|
435
|
-
##### `CBCTypes`
|
|
435
|
+
##### `Cph.CBCTypes`
|
|
436
436
|
|
|
437
437
|
Cipher CBC algorithm types.
|
|
438
438
|
|
|
439
439
|
---
|
|
440
440
|
|
|
441
|
-
##### `AesAlgorithm`
|
|
441
|
+
##### `Cph.AesAlgorithm`
|
|
442
442
|
|
|
443
443
|
Supported AES algorithm types.
|
|
444
444
|
|
|
@@ -452,9 +452,9 @@ Common options in encryption/decryption processes.
|
|
|
452
452
|
|
|
453
453
|
<summary>Type parameters</summary>
|
|
454
454
|
|
|
455
|
-
| Parameter
|
|
456
|
-
|
|
457
|
-
| `T`
|
|
455
|
+
| Parameter | Default | Description |
|
|
456
|
+
|-----------|----------------|-------------|
|
|
457
|
+
| `T` | `Cph.AesAlgorithm` | Accepted algorithm in `Cph.Options`. This is usefull to constraint specifc algorithms. |
|
|
458
458
|
|
|
459
459
|
</details>
|
|
460
460
|
|
|
@@ -923,21 +923,19 @@ Run all the defined test suites by running the following:
|
|
|
923
923
|
# Run tests and watch file changes.
|
|
924
924
|
pnpm test:watch
|
|
925
925
|
|
|
926
|
-
# Run tests and watch file changes with jest-environment-jsdom.
|
|
927
|
-
pnpm test:jsdom
|
|
928
|
-
|
|
929
926
|
# Run tests in a CI environment.
|
|
930
927
|
pnpm test:ci
|
|
931
|
-
|
|
932
|
-
# Run tests in a CI environment with jest-environment-jsdom.
|
|
933
|
-
pnpm test:ci:jsdom
|
|
934
928
|
```
|
|
935
929
|
|
|
936
930
|
You can eventually run specific suits like so:
|
|
937
931
|
|
|
938
932
|
```bash
|
|
939
|
-
pnpm test:
|
|
940
|
-
pnpm test:
|
|
933
|
+
pnpm test:buffer-in-memory
|
|
934
|
+
pnpm test:file-symmetric
|
|
935
|
+
pnpm test:file-hybrid
|
|
936
|
+
pnpm test:stream-symmetric
|
|
937
|
+
pnpm test:stream-hybrid
|
|
938
|
+
pnpm test:misc
|
|
941
939
|
```
|
|
942
940
|
|
|
943
941
|
Run tests with coverage.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/crypto-cipher",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Node.js Cipher cryptograph utility library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alessio Frittoli",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@eslint/js": "^9.18.0",
|
|
72
72
|
"@jest/globals": "^29.7.0",
|
|
73
73
|
"@types/jest": "^29.5.14",
|
|
74
|
-
"@types/node": "^22.10.
|
|
74
|
+
"@types/node": "^22.10.7",
|
|
75
75
|
"concurrently": "^9.1.2",
|
|
76
76
|
"dotenv": "^16.4.7",
|
|
77
77
|
"eslint": "^9.18.0",
|