sdc-cli 1.0.0 → 1.0.2
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/askpass.js +1 -5
- package/cli.js +3 -3
- package/package.json +8 -3
- package/enc +0 -0
package/askpass.js
CHANGED
package/cli.js
CHANGED
|
@@ -227,7 +227,7 @@ class CryptCLI {
|
|
|
227
227
|
// File encryption
|
|
228
228
|
const fileReader = await this.createFileReader(inputFile);
|
|
229
229
|
const fileWriter = await this.createFileWriter(outputFile || '-');
|
|
230
|
-
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript =
|
|
230
|
+
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript = 'sdc-askpass';
|
|
231
231
|
const password = await this.getPassword(options, 'password');
|
|
232
232
|
|
|
233
233
|
const success = await encrypt_file(fileReader, fileWriter, password);
|
|
@@ -274,7 +274,7 @@ class CryptCLI {
|
|
|
274
274
|
// File decryption
|
|
275
275
|
const fileReader = await this.createFileReader(inputFile);
|
|
276
276
|
const fileWriter = await this.createFileWriter(outputFile || '-');
|
|
277
|
-
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript =
|
|
277
|
+
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript = 'sdc-askpass';
|
|
278
278
|
const password = await this.getPassword(options, 'password');
|
|
279
279
|
|
|
280
280
|
const success = await decrypt_file(fileReader, fileWriter, password);
|
|
@@ -321,7 +321,7 @@ class CryptCLI {
|
|
|
321
321
|
} else {
|
|
322
322
|
fileBuffer = await fs.readFile(inputFile);
|
|
323
323
|
}
|
|
324
|
-
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript =
|
|
324
|
+
if (inputFile === '-' && (!options.passwordScript)) options.passwordScript = 'sdc-askpass';
|
|
325
325
|
|
|
326
326
|
// Take first 5KB or entire file if smaller
|
|
327
327
|
const headerSize = Math.min(5 * 1024, fileBuffer.length);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdc-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A useful CLI in Node.js to use simple-data-crypto library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"encryption",
|
|
@@ -8,13 +8,18 @@
|
|
|
8
8
|
"cli",
|
|
9
9
|
"back-end"
|
|
10
10
|
],
|
|
11
|
-
"bin":
|
|
11
|
+
"bin": {
|
|
12
|
+
"sdc-cli": "cli.js",
|
|
13
|
+
"sdc-askpass": "askpass.js"
|
|
14
|
+
},
|
|
12
15
|
"license": "MIT",
|
|
13
16
|
"author": "chcs1013",
|
|
14
17
|
"type": "module",
|
|
15
18
|
"main": "cli.js",
|
|
16
19
|
"scripts": {
|
|
17
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
20
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
21
|
+
"askpass": "node askpass.js",
|
|
22
|
+
"cli": "node cli.js"
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
25
|
"commander": "^14.0.2",
|
package/enc
DELETED
|
Binary file
|