xypriss-security 2.1.11 → 2.1.13
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/dist/src/core/keys.d.ts +43 -4
- package/dist/src/core/keys.d.ts.map +1 -1
- package/dist/src/core/keys.js +136 -46
- package/dist/src/core/keys.js.map +1 -1
- package/package.json +9 -8
package/dist/src/core/keys.d.ts
CHANGED
|
@@ -51,15 +51,54 @@ export declare class Keys {
|
|
|
51
51
|
*/
|
|
52
52
|
static rsaDecrypt(privateKey: string, encryptedHex: string): Promise<string>;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* Encrypts a large file using high-performance, hardware-accelerated chunking.
|
|
55
|
+
*
|
|
56
|
+
* @description
|
|
57
|
+
* Processes files via a native encryption bridge using derived keys (PBKDF2).
|
|
58
|
+
* Implements a staging strategy to ensure data integrity: ciphertext is
|
|
59
|
+
* finalized with a 32-byte salt header before an atomic move to the target path.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} inputPath - Absolute path to the source file.
|
|
62
|
+
* @param {string} outputPath - Target destination for the encrypted data.
|
|
63
|
+
* @param {string} key - Raw passphrase for cryptographic derivation.
|
|
64
|
+
* @param {object} [options={}] - Encryption parameters.
|
|
65
|
+
* @param {string} [options.algorithm="aes-256-gcm"] - Selection of the cipher suite.
|
|
66
|
+
* @param {number} [options.keyDerivationIterations=100000] - Cost factor for PBKDF2.
|
|
67
|
+
* @param {boolean} [options.quantumSafe=false] - If true, enforces Post-Quantum resistant ciphers.
|
|
68
|
+
*
|
|
69
|
+
* @throws {Error | SystemError} On bridge failure, I/O exhaustion, or permission issues.
|
|
70
|
+
* @returns {Promise<void>}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await Cipher.crypto.encryptFile('./data.zip', './data.vault', 'secret-key');
|
|
56
74
|
*/
|
|
57
75
|
static encryptFile(inputPath: string, outputPath: string, key: string, options?: any): Promise<void>;
|
|
58
76
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
77
|
+
* Decrypts a large file using PBKDF2 key derivation and a secure bridge.
|
|
78
|
+
*
|
|
79
|
+
* @description
|
|
80
|
+
* This method extracts a 32-byte salt from the input file header, derives a 256-bit key
|
|
81
|
+
* (100,000 iterations), and performs decryption via temporary staging files to
|
|
82
|
+
* ensure data integrity. The final output is moved atomically.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} inputPath - Absolute path to the encrypted source file.
|
|
85
|
+
* @param {string} outputPath - Destination path for the decrypted plaintext.
|
|
86
|
+
* @param {string} key - The raw passphrase used for key derivation.
|
|
87
|
+
*
|
|
88
|
+
* @throws {Error} If the salt extraction fails or the decryption bridge returns an error.
|
|
89
|
+
* @throws {SystemError} If disk space is insufficient for temp files or if file moves fail.
|
|
90
|
+
*
|
|
91
|
+
* @returns {Promise<void>} Resolves once the file is successfully decrypted and moved to `outputPath`.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* await Cipher.crypto.decryptFile('./vault.enc', './vault.txt', 'super-secret-key');
|
|
61
95
|
*/
|
|
62
96
|
static decryptFile(inputPath: string, outputPath: string, key: string): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Moves a file atomically from src to dest.
|
|
99
|
+
* Handles EXDEV errors for cross-partition moves.
|
|
100
|
+
*/
|
|
101
|
+
private static moveFileAtomic;
|
|
63
102
|
}
|
|
64
103
|
/**
|
|
65
104
|
* Generates a high-entropy 4096-bit RSA key pair.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/core/keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKhD,qBAAa,IAAI;IACf;;;;;;;OAOG;WACiB,SAAS,CAC3B,KAAK,EAAE,MAAM,GAAG,UAAU,EAC1B,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,M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C,OAAO,CAAC;IAInB;;;;;OAKG;WACiB,UAAU,CAC5B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;;OAKG;WACiB,UAAU,CAC5B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;;;;;;;;;;;;;;;;;;OAqBG;WACiB,WAAW,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,GAAQ,GAChB,OAAO,CAAC,IAAI,CAAC;IA2DhB;;;;;;;;;;;;;;;;;;;OAmBG;WACiB,WAAW,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC;IAkDhB;;;OAGG;mBACkB,cAAc;CAmBpC;AAID;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gCAA0B,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,qBAAe,CAAC;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,wBAAkB,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,wBAAkB,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
|
package/dist/src/core/keys.js
CHANGED
|
@@ -83,61 +83,151 @@ class Keys {
|
|
|
83
83
|
return bridge_1.Bridge.rsaDecrypt(privateKey, encryptedHex);
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
86
|
+
* Encrypts a large file using high-performance, hardware-accelerated chunking.
|
|
87
|
+
*
|
|
88
|
+
* @description
|
|
89
|
+
* Processes files via a native encryption bridge using derived keys (PBKDF2).
|
|
90
|
+
* Implements a staging strategy to ensure data integrity: ciphertext is
|
|
91
|
+
* finalized with a 32-byte salt header before an atomic move to the target path.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} inputPath - Absolute path to the source file.
|
|
94
|
+
* @param {string} outputPath - Target destination for the encrypted data.
|
|
95
|
+
* @param {string} key - Raw passphrase for cryptographic derivation.
|
|
96
|
+
* @param {object} [options={}] - Encryption parameters.
|
|
97
|
+
* @param {string} [options.algorithm="aes-256-gcm"] - Selection of the cipher suite.
|
|
98
|
+
* @param {number} [options.keyDerivationIterations=100000] - Cost factor for PBKDF2.
|
|
99
|
+
* @param {boolean} [options.quantumSafe=false] - If true, enforces Post-Quantum resistant ciphers.
|
|
100
|
+
*
|
|
101
|
+
* @throws {Error | SystemError} On bridge failure, I/O exhaustion, or permission issues.
|
|
102
|
+
* @returns {Promise<void>}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await Cipher.crypto.encryptFile('./data.zip', './data.vault', 'secret-key');
|
|
88
106
|
*/
|
|
89
107
|
static async encryptFile(inputPath, outputPath, key, options = {}) {
|
|
90
108
|
const fs = require("fs");
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
const os = require("os");
|
|
110
|
+
const path = require("path");
|
|
111
|
+
const { pipeline: pl } = require("stream");
|
|
112
|
+
const { promisify: pr } = require("util");
|
|
113
|
+
const pipelineAsync = pr(pl);
|
|
114
|
+
const id = Math.random().toString(36).substring(7);
|
|
115
|
+
const tmpDir = os.tmpdir();
|
|
116
|
+
const goTempPath = path.join(tmpDir, `xy-enc-${id}.go.tmp`);
|
|
117
|
+
const finalTempPath = path.join(tmpDir, `xy-enc-${id}.out.tmp`);
|
|
118
|
+
try {
|
|
119
|
+
const { algorithm = "aes-256-gcm", keyDerivationIterations = 100000, quantumSafe = false, } = options;
|
|
120
|
+
const SALT_LENGTH = 32;
|
|
121
|
+
const salt = Random_1.Random.getRandomBytes(SALT_LENGTH);
|
|
122
|
+
const derivedKeyHex = await bridge_1.Bridge.pbkdf2(key, salt.toUint8Array(), keyDerivationIterations, 32, "sha256");
|
|
123
|
+
const derivedKey = Buffer.from(derivedKeyHex, "hex");
|
|
124
|
+
const algoTarget = algorithm === "chacha20-poly1305" || quantumSafe ? "chacha20" : "aes";
|
|
125
|
+
// 1. Encrypt input into a temporary Go output file
|
|
126
|
+
const result = bridge_1.Bridge.encryptFile(inputPath, goTempPath, derivedKey, algoTarget);
|
|
127
|
+
if (result !== "OK")
|
|
128
|
+
throw new Error(result);
|
|
129
|
+
// 2. Combine Salt + Go Output into finalTempPath
|
|
130
|
+
fs.writeFileSync(finalTempPath, Buffer.from(salt.toUint8Array()));
|
|
131
|
+
const finalOut = fs.createWriteStream(finalTempPath, { flags: "a" });
|
|
132
|
+
const goTempIn = fs.createReadStream(goTempPath);
|
|
133
|
+
await pipelineAsync(goTempIn, finalOut);
|
|
134
|
+
// 3. Atomically move to final output
|
|
135
|
+
await this.moveFileAtomic(finalTempPath, outputPath);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (fs.existsSync(finalTempPath))
|
|
139
|
+
fs.unlinkSync(finalTempPath);
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
if (fs.existsSync(goTempPath))
|
|
144
|
+
fs.unlinkSync(goTempPath);
|
|
145
|
+
}
|
|
113
146
|
}
|
|
114
147
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
148
|
+
* Decrypts a large file using PBKDF2 key derivation and a secure bridge.
|
|
149
|
+
*
|
|
150
|
+
* @description
|
|
151
|
+
* This method extracts a 32-byte salt from the input file header, derives a 256-bit key
|
|
152
|
+
* (100,000 iterations), and performs decryption via temporary staging files to
|
|
153
|
+
* ensure data integrity. The final output is moved atomically.
|
|
154
|
+
*
|
|
155
|
+
* @param {string} inputPath - Absolute path to the encrypted source file.
|
|
156
|
+
* @param {string} outputPath - Destination path for the decrypted plaintext.
|
|
157
|
+
* @param {string} key - The raw passphrase used for key derivation.
|
|
158
|
+
*
|
|
159
|
+
* @throws {Error} If the salt extraction fails or the decryption bridge returns an error.
|
|
160
|
+
* @throws {SystemError} If disk space is insufficient for temp files or if file moves fail.
|
|
161
|
+
*
|
|
162
|
+
* @returns {Promise<void>} Resolves once the file is successfully decrypted and moved to `outputPath`.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* await Cipher.crypto.decryptFile('./vault.enc', './vault.txt', 'super-secret-key');
|
|
117
166
|
*/
|
|
118
167
|
static async decryptFile(inputPath, outputPath, key) {
|
|
119
168
|
const fs = require("fs");
|
|
120
|
-
const
|
|
169
|
+
const os = require("os");
|
|
170
|
+
const path = require("path");
|
|
171
|
+
const { pipeline: pl2 } = require("stream");
|
|
172
|
+
const { promisify: pr2 } = require("util");
|
|
173
|
+
const pipelineAsync2 = pr2(pl2);
|
|
121
174
|
const SALT_LENGTH = 32;
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
finalInStream.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
175
|
+
const id = Math.random().toString(36).substring(7);
|
|
176
|
+
const tmpDir = os.tmpdir();
|
|
177
|
+
const tempInPath = path.join(tmpDir, `xy-dec-${id}.in.tmp`);
|
|
178
|
+
const tempOutPath = path.join(tmpDir, `xy-dec-${id}.out.tmp`);
|
|
179
|
+
try {
|
|
180
|
+
const fd = fs.openSync(inputPath, "r");
|
|
181
|
+
const salt = Buffer.alloc(SALT_LENGTH);
|
|
182
|
+
fs.readSync(fd, salt, 0, SALT_LENGTH, 0);
|
|
183
|
+
fs.closeSync(fd);
|
|
184
|
+
const derivedKeyHex = await bridge_1.Bridge.pbkdf2(key, salt, 100000, 32, "sha256");
|
|
185
|
+
const derivedKey = Buffer.from(derivedKeyHex, "hex");
|
|
186
|
+
// 1. Prepare input for Go (remove salt) into tempInPath
|
|
187
|
+
const finalInStream = fs.createReadStream(inputPath, {
|
|
188
|
+
start: SALT_LENGTH,
|
|
189
|
+
});
|
|
190
|
+
const tempOutInStream = fs.createWriteStream(tempInPath);
|
|
191
|
+
await pipelineAsync2(finalInStream, tempOutInStream);
|
|
192
|
+
// 2. Decrypt from tempInPath to tempOutPath
|
|
193
|
+
const result = bridge_1.Bridge.decryptFile(tempInPath, tempOutPath, derivedKey);
|
|
194
|
+
if (result !== "OK")
|
|
195
|
+
throw new Error(result);
|
|
196
|
+
// 3. Atomically move to final output
|
|
197
|
+
await this.moveFileAtomic(tempOutPath, outputPath);
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (fs.existsSync(tempOutPath))
|
|
201
|
+
fs.unlinkSync(tempOutPath);
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
if (fs.existsSync(tempInPath))
|
|
206
|
+
fs.unlinkSync(tempInPath);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Moves a file atomically from src to dest.
|
|
211
|
+
* Handles EXDEV errors for cross-partition moves.
|
|
212
|
+
*/
|
|
213
|
+
static async moveFileAtomic(src, dest) {
|
|
214
|
+
const fs = require("fs");
|
|
215
|
+
try {
|
|
216
|
+
// Fast path: rename (on same partition)
|
|
217
|
+
if (fs.existsSync(dest) && src !== dest)
|
|
218
|
+
fs.unlinkSync(dest);
|
|
219
|
+
fs.renameSync(src, dest);
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
// Fallback path: copy + unlink (cross-partition)
|
|
223
|
+
if (error.code === "EXDEV") {
|
|
224
|
+
fs.copyFileSync(src, dest);
|
|
225
|
+
fs.unlinkSync(src);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
141
231
|
}
|
|
142
232
|
}
|
|
143
233
|
exports.Keys = Keys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/core/keys.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAAsC;AACtC,qCAAkC;AAClC,qCAAkC;AAElC,MAAa,IAAI;IACf;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,SAAS,CAC3B,KAA0B,EAC1B,UAAgC,EAAE;QAElC,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7D,MAAM,QAAQ,GACZ,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEtE,wCAAwC;QACxC,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,eAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;YACtE,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACtE,OAAO,eAAM,CAAC,MAAM,CAClB,QAAQ,EACR,SAAS,EACT,OAAO,CAAC,UAAU,IAAI,MAAM,EAC5B,OAAO,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AC,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xypriss-security",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.13",
|
|
4
4
|
"description": "Advanced High-Performance Security Framework. Military-grade encryption, post-quantum resilience, and fortified data structures.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "NEHONIX",
|
|
7
7
|
"url": "https://nehonix.com"
|
|
8
8
|
},
|
|
9
|
+
"main": "dist/src/index.js",
|
|
10
|
+
"types": "dist/src/index.d.ts",
|
|
9
11
|
"files": [
|
|
10
12
|
"dist",
|
|
11
13
|
"scripts"
|
|
12
14
|
],
|
|
13
|
-
"main": "dist/src/index.js",
|
|
14
|
-
"types": "dist/src/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "xfpm run build:ts",
|
|
16
|
+
"build": "xfpm run build:ts",
|
|
17
|
+
"build:all": "npm run build \u0026\u0026 npm run build:release",
|
|
17
18
|
"build:core": "node scripts/build-core.js",
|
|
18
|
-
"build:ts": "rimraf dist && tsc && mkdir -p dist/src/mods && cp src/mods/*.txt dist/src/mods/",
|
|
19
19
|
"build:release": "bash scripts/release-build.sh",
|
|
20
|
-
"build:
|
|
20
|
+
"build:ts": "rimraf dist \u0026\u0026 tsc \u0026\u0026 mkdir -p dist/src/mods \u0026\u0026 cp src/mods/*.txt dist/src/mods/",
|
|
21
21
|
"postinstall": "node scripts/build-core.js",
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"test": "bun run lib/test_ultra_robust.ts"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@types/node": "^25.4.0",
|
|
34
34
|
"bun": "^1.3.10",
|
|
35
35
|
"rimraf": "^5.0.10",
|
|
36
|
-
"typescript": "^5.9.3"
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"xypriss": "^9.4.7"
|
|
37
38
|
}
|
|
38
|
-
}
|
|
39
|
+
}
|