@syferit/cli 0.4.4 → 0.4.6
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 +13 -6
- package/dist/bin.js +14 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +87 -114
- package/package.json +5 -5
- package/src/bin.ts +2 -2
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://syferit.soltrixstudios.com">
|
|
3
|
+
<img src="../../assets/icon.png" alt="Syferit Logo" width="80" height="80" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
>
|
|
7
|
+
<h1 align="center">@syferit/cli</h1>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Universal Binary & Source Code Hardener</strong><br>
|
|
11
|
+
<em>“Don't Just Ship it. Syferit.”</em>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
> Command-line tool for protecting JavaScript, TypeScript, WebAssembly, and native binaries with Syferit. Part of the **[Syferit](https://syferit.soltrixstudios.com)** code defense framework by **[Soltrix Studios](https://soltrixstudios.com)**.
|
|
8
15
|
|
|
9
16
|
---
|
|
10
17
|
|
|
@@ -44,8 +51,8 @@ syferit protect ./dist/app.js --preset maximum
|
|
|
44
51
|
| `-d, --domain <domain>` | Domain dictionary profile: `saas`, `fintech`, `security`, `gaming` | `'saas'` |
|
|
45
52
|
| `-p, --profile <profile>` | Alias for `-d, --domain` (smart auto-routes if preset name given) | `'saas'` |
|
|
46
53
|
| `-s, --seed <seed>` | Deterministic seed for reproducible polymorphism | *(Auto-generated UUIDv4)* |
|
|
47
|
-
| `-v, --version` | Output the current Syferit version |
|
|
48
|
-
| `-h, --help` | Display CLI help and flag usage |
|
|
54
|
+
| `-v, --version` | Output the current Syferit version | N/A |
|
|
55
|
+
| `-h, --help` | Display CLI help and flag usage | N/A |
|
|
49
56
|
|
|
50
57
|
> [!TIP]
|
|
51
58
|
> **Smart Collision Avoidance:** If you pass `-p standard` or `-p maximum` (thinking `-p` was preset), Syferit automatically detects the preset value and routes it to `--preset` without error.
|
package/dist/bin.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Command } from 'commander';
|
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { protectFile, protectDirectory } from './index.js';
|
|
7
|
-
function
|
|
8
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
7
|
+
function assertRingBufferIntegrity_fd97(_tok0, _tok1, _tok2, _tok3) {
|
|
8
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:f3239365-d245cc9d]",
|
|
9
9
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
10
10
|
let _h = 2166136261;
|
|
11
11
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -23,21 +23,21 @@ function auditTpmPcrBankAttestation_c709(_tok0, _tok1, _tok2, _tok3) {
|
|
|
23
23
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
24
24
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
25
25
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
26
|
-
if ((_h >>> 4 & 15) !==
|
|
26
|
+
if ((_h >>> 4 & 15) !== 2) {
|
|
27
27
|
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
28
28
|
}
|
|
29
29
|
return _h;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
const _row =
|
|
35
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (
|
|
31
|
+
const __keyDerivationStateIntegrity_fd97 = assertRingBufferIntegrity_fd97(422519099, 1671097669, 356768137, 373134081);
|
|
32
|
+
const _targetArgAttestation_fd97 = [[84, 42, 6, 175, 223, 147, 137, 49], [36, 226, 254, 130, 133, 121, 69, 30], [28, 201, 201, 98, 104, 73, 40], [229, 180, 176, 85, 88, 8, 30], [232, 139, 157, 48, 61, 239, 251, 211, 195, 73, 90, 16, 21, 193, 219, 120, 104, 98, 13, 192, 246, 165, 171, 92, 95, 74, 85, 237, 149, 155, 116, 8, 63, 231, 254, 213, 166, 72, 91, 236, 228, 200, 170, 105, 110, 110, 3, 195, 202, 140, 152, 35, 80, 4, 18, 188, 161, 42, 113, 20, 71, 205, 200, 109, 143, 64, 82, 237, 175, 149, 187, 92, 71, 51, 12, 206], [208, 57, 20, 84, 65], [117, 78, 42, 235, 252, 179, 173, 19, 118, 16, 12, 181, 166, 157, 117, 6], [107, 17, 26, 168, 199, 213, 191, 11, 6, 169, 254, 131, 129, 116, 69, 160, 31, 223, 206, 117, 96, 34, 34, 205, 207, 188, 140, 72, 22, 12, 24, 180, 234, 114, 111, 9, 63, 251, 234, 145, 145, 9, 66, 254, 233, 201, 163, 67, 110, 56, 53, 218, 142, 145, 129, 104, 35, 89, 228, 181, 186, 104, 54, 31, 24, 129, 206, 109, 140, 80, 93, 236, 253, 187, 171], [98, 242, 163, 201, 206, 55, 87, 28, 5, 201, 210, 101, 43, 126, 59, 196, 235, 190, 225], [36, 202, 192, 102, 40, 75, 39, 130, 250, 186, 176, 83, 16, 8, 2, 234, 160, 146, 118, 59, 59, 251, 247, 128, 149, 3, 88, 233, 160, 199, 178, 117, 96, 46, 55, 218], [180, 191, 245, 19, 0, 73, 2, 178, 181, 216, 61, 43, 52, 248, 253, 209], [250, 144, 141, 44, 59, 231, 243, 152, 143, 114, 72, 160, 21, 196, 206, 100, 123, 49, 110, 216, 195, 173, 138, 28, 30, 9, 19, 182, 171, 116, 102, 16, 45, 181, 234, 151, 210, 64, 92, 161, 246, 209, 167, 67, 127, 113, 53, 194, 203, 151, 153, 58, 43, 13, 231, 245], [206, 55, 76, 8, 3, 222, 194, 101, 43, 126, 59, 196, 235, 190, 225], [73, 83, 33, 195, 239, 243, 186, 89, 66, 71, 93, 165, 232, 219, 41, 115, 55, 250, 236], [0, 73, 29, 181, 164, 139, 100, 47, 117, 176, 229, 157, 140, 83, 76, 247, 67], [2, 251, 253, 152, 131, 126, 82, 233, 21, 223, 154, 120, 107, 51, 43, 196, 152, 249, 145, 72, 87, 3, 18, 177, 184, 101, 38, 68, 54, 244, 236, 156, 151, 71, 87, 232, 170, 157, 169, 82, 58, 60, 59, 204, 199, 136, 155, 37], [31, 207, 197, 117, 110, 44, 46, 193], [177, 163, 240, 22, 29, 74, 0, 184, 171, 157, 109, 50, 61, 175, 164, 130, 158, 76, 74, 239, 236, 210, 254], [133, 151, 108, 58, 60, 226, 181, 139, 128, 67, 93, 234, 18, 218, 220, 101, 104, 104, 33, 217, 202, 186, 140, 83, 92, 80, 81, 160, 172, 101, 126, 75, 65, 254, 200, 149, 129, 73, 86, 231, 165, 224, 186, 70, 126, 33, 47, 222, 197, 145, 221, 107, 34, 29, 232, 182, 183, 119, 48], [149, 124, 71, 243], [38, 38, 103, 133, 178, 251, 187, 86, 94, 11, 26, 163, 231, 194, 99, 14, 54, 243, 242, 155, 209], [113, 11, 25, 171, 183, 219, 98, 49, 42, 175, 181, 130, 192, 3, 1, 171, 240, 197, 175, 124, 125, 39, 49], [120, 255, 185, 207, 196, 13, 90, 230, 24, 208, 157, 43, 98, 45, 52, 207, 155], [62, 212, 206, 113, 124, 40, 39, 198, 203, 170, 150, 85, 85, 77, 20, 165, 163, 109, 110, 68, 45, 240, 251, 156, 210, 79, 93, 254, 166, 207, 163, 80, 104, 62, 62, 193, 205, 140, 140, 36, 39, 89, 242, 179, 186, 116, 123, 31, 24, 209, 194, 109, 141, 88]];
|
|
33
|
+
function _isolateSgxBoundaryEnvelope_fd97(_slot) {
|
|
34
|
+
const _row = _targetArgAttestation_fd97[_slot];
|
|
35
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__keyDerivationStateIntegrity_fd97 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
36
36
|
}
|
|
37
|
-
const PRESET_VALUES = new Set([
|
|
37
|
+
const PRESET_VALUES = new Set([_isolateSgxBoundaryEnvelope_fd97(8304 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 6487)), _isolateSgxBoundaryEnvelope_fd97(6277 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 8611)), _isolateSgxBoundaryEnvelope_fd97(24061 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 25816))]);
|
|
38
38
|
const program = new Command();
|
|
39
|
-
program.name(
|
|
40
|
-
program.command(
|
|
39
|
+
program.name(_isolateSgxBoundaryEnvelope_fd97(29632 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 19172))).description(_isolateSgxBoundaryEnvelope_fd97(13576 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 3115))).version(_isolateSgxBoundaryEnvelope_fd97(31700 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 17142)));
|
|
40
|
+
program.command(_isolateSgxBoundaryEnvelope_fd97(22184 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 28553))).description(_isolateSgxBoundaryEnvelope_fd97(8339 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 6579))).option(_isolateSgxBoundaryEnvelope_fd97(21879 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 27736)), _isolateSgxBoundaryEnvelope_fd97(3475 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 13501))).option(_isolateSgxBoundaryEnvelope_fd97(25110 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 23355)), _isolateSgxBoundaryEnvelope_fd97(24885 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 22553))).option(_isolateSgxBoundaryEnvelope_fd97(14351 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 292)), _isolateSgxBoundaryEnvelope_fd97(868 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 14926))).option(_isolateSgxBoundaryEnvelope_fd97(24147 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 26490)), _isolateSgxBoundaryEnvelope_fd97(538 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 15154)), _isolateSgxBoundaryEnvelope_fd97(31669 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 17026))).option(_isolateSgxBoundaryEnvelope_fd97(11076 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 4722)), _isolateSgxBoundaryEnvelope_fd97(20327 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 30290)), _isolateSgxBoundaryEnvelope_fd97(1520 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 15556))).option(_isolateSgxBoundaryEnvelope_fd97(21362 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 27201)), _isolateSgxBoundaryEnvelope_fd97(9259 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 7449))).option(_isolateSgxBoundaryEnvelope_fd97(16702 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 30735)), _isolateSgxBoundaryEnvelope_fd97(17395 ^ (__keyDerivationStateIntegrity_fd97 & 65535 ^ 31427))).action((targetArg, options) => {
|
|
41
41
|
const rawTarget = targetArg || options.target;
|
|
42
42
|
if (!rawTarget) {
|
|
43
43
|
console.error('Error: Please specify a target file or directory to protect (e.g. `syferit protect ./dist` or `syferit protect -t ./dist`)');
|
|
@@ -74,8 +74,8 @@ program.command(_assertProtectFile_c709(17772 ^ (__entropyNonceVector_c709 & 655
|
|
|
74
74
|
});
|
|
75
75
|
program.parse(process.argv);
|
|
76
76
|
if (typeof window !== "undefined") {
|
|
77
|
-
window.
|
|
78
|
-
syncEpoch:
|
|
79
|
-
channelSig: "
|
|
77
|
+
window.__syferitIPC_fa4b && window.__syferitIPC_fa4b.invoke && window.__syferitIPC_fa4b.invoke("crypto:tpm-enclave-verify", {
|
|
78
|
+
syncEpoch: 1308161214,
|
|
79
|
+
channelSig: "SIG_FRAME_FA4B"
|
|
80
80
|
});
|
|
81
81
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [Protected by Soltrix Studios
|
|
1
|
+
// [Protected by Soltrix Studios | Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
2
|
import type { SyferitOptions } from '@syferit/core';
|
|
3
3
|
export interface CliProtectOptions extends SyferitOptions {
|
|
4
4
|
out?: string;
|
package/dist/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import { protectWasm } from '@syferit/wasm';
|
|
|
6
6
|
import { protectLlvmIr, protectNativeSource } from '@syferit/llvm';
|
|
7
7
|
import { protectPython } from '@syferit/python';
|
|
8
8
|
export function protectFile(filePath, outPath, options) {
|
|
9
|
-
function
|
|
10
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
9
|
+
function auditPath_1ecf(_tok0, _tok1, _tok2, _tok3) {
|
|
10
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:4d41196d-6c5a2f2a]",
|
|
11
11
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
12
12
|
let _h = 2166136261;
|
|
13
13
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -25,75 +25,75 @@ export function protectFile(filePath, outPath, options) {
|
|
|
25
25
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
26
26
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
27
27
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
28
|
-
if ((_h >>> 4 & 15) !==
|
|
29
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
28
|
+
if ((_h >>> 4 & 15) !== 9) {
|
|
29
|
+
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
30
30
|
}
|
|
31
31
|
return _h;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
const _row =
|
|
37
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (
|
|
33
|
+
const __ringBufferBitmask_1ecf = auditPath_1ecf(445681529, 972206971, 514079737, 573858603);
|
|
34
|
+
const _protectPythonEnvelope_1ecf = [[183, 70, 193, 64, 64], [144, 58, 169], [205, 9, 153], [38, 208, 118], [88, 177, 82, 234, 249], [39, 158, 63, 193, 222], [2, 123, 24, 60, 51], [238, 65, 208, 66], [162, 41, 184], [147, 10, 139, 173, 66], [126, 215, 116, 136, 167], [69, 188, 81, 231, 252], [32, 153, 58, 194, 209], [15, 102, 231, 57, 54]];
|
|
35
|
+
function _attestProtectFile_1ecf(_slot) {
|
|
36
|
+
const _row = _protectPythonEnvelope_1ecf[_slot];
|
|
37
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__ringBufferBitmask_1ecf >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
38
38
|
}
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
if (!fs.existsSync(
|
|
47
|
-
fs.mkdirSync(
|
|
39
|
+
const _ringBufferEnvelope_bef = filePath.endsWith(_attestProtectFile_1ecf(25174 ^ (__ringBufferBitmask_1ecf & 65535 ^ 28367)));
|
|
40
|
+
const _protectFileEnvelope_4ba = filePath.endsWith(_attestProtectFile_1ecf(19563 ^ (__ringBufferBitmask_1ecf & 65535 ^ 16627)));
|
|
41
|
+
const _sgxBoundaryProof_7a9 = filePath.endsWith(_attestProtectFile_1ecf(12939 ^ (__ringBufferBitmask_1ecf & 65535 ^ 15888)));
|
|
42
|
+
const _protectVector_b51 = /\.(c|cpp|cc|cxx)$/i.test(filePath);
|
|
43
|
+
const _hmacFrameProof_79b = filePath.endsWith(_attestProtectFile_1ecf(17074 ^ (__ringBufferBitmask_1ecf & 65535 ^ 20008)));
|
|
44
|
+
const _monotonicNonceDrift_cc9 = outPath || filePath;
|
|
45
|
+
const _dirnameAttestation_a50 = path.dirname(_monotonicNonceDrift_cc9);
|
|
46
|
+
if (!fs.existsSync(_dirnameAttestation_a50)) {
|
|
47
|
+
fs.mkdirSync(_dirnameAttestation_a50, {
|
|
48
48
|
recursive: true
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (_ringBufferEnvelope_bef) {
|
|
52
52
|
const wasmBytes = fs.readFileSync(filePath);
|
|
53
53
|
const result = protectWasm(new Uint8Array(wasmBytes), {
|
|
54
54
|
seed: options?.seed,
|
|
55
55
|
domainProfile: options?.domainProfile
|
|
56
56
|
});
|
|
57
|
-
fs.writeFileSync(
|
|
57
|
+
fs.writeFileSync(_monotonicNonceDrift_cc9, result.binary);
|
|
58
58
|
return {
|
|
59
|
-
transformed: result.sectionsProtected > (
|
|
59
|
+
transformed: result.sectionsProtected > (13799 ^ (__ringBufferBitmask_1ecf & 65535 ^ 14718))
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
const irCode = fs.readFileSync(filePath,
|
|
62
|
+
if (_protectFileEnvelope_4ba) {
|
|
63
|
+
const irCode = fs.readFileSync(filePath, _attestProtectFile_1ecf(21387 ^ (__ringBufferBitmask_1ecf & 65535 ^ 24342)));
|
|
64
64
|
const result = protectLlvmIr(irCode, options);
|
|
65
|
-
fs.writeFileSync(
|
|
65
|
+
fs.writeFileSync(_monotonicNonceDrift_cc9, result.code, _attestProtectFile_1ecf(32723 ^ (__ringBufferBitmask_1ecf & 65535 ^ 29519)));
|
|
66
66
|
return {
|
|
67
|
-
transformed: result.transformedCount > (
|
|
67
|
+
transformed: result.transformedCount > (26287 ^ (__ringBufferBitmask_1ecf & 65535 ^ 27190))
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
71
|
-
const srcCode = fs.readFileSync(filePath,
|
|
70
|
+
if (_sgxBoundaryProof_7a9 || _protectVector_b51) {
|
|
71
|
+
const srcCode = fs.readFileSync(filePath, _attestProtectFile_1ecf(25964 ^ (__ringBufferBitmask_1ecf & 65535 ^ 27123)));
|
|
72
72
|
const result = protectNativeSource(srcCode, {
|
|
73
73
|
...options,
|
|
74
|
-
targetLanguage:
|
|
74
|
+
targetLanguage: _sgxBoundaryProof_7a9 ? _attestProtectFile_1ecf(25677 ^ (__ringBufferBitmask_1ecf & 65535 ^ 26835)) : _attestProtectFile_1ecf(17048 ^ (__ringBufferBitmask_1ecf & 65535 ^ 19977))
|
|
75
75
|
});
|
|
76
|
-
fs.writeFileSync(
|
|
76
|
+
fs.writeFileSync(_monotonicNonceDrift_cc9, result.code, _attestProtectFile_1ecf(23015 ^ (__ringBufferBitmask_1ecf & 65535 ^ 21879)));
|
|
77
77
|
return {
|
|
78
|
-
transformed: result.transformedCount > (
|
|
78
|
+
transformed: result.transformedCount > (9947 ^ (__ringBufferBitmask_1ecf & 65535 ^ 10818))
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
82
|
-
const pyCode = fs.readFileSync(filePath,
|
|
81
|
+
if (_hmacFrameProof_79b) {
|
|
82
|
+
const pyCode = fs.readFileSync(filePath, _attestProtectFile_1ecf(6434 ^ (__ringBufferBitmask_1ecf & 65535 ^ 5553)));
|
|
83
83
|
const result = protectPython(pyCode, options);
|
|
84
|
-
fs.writeFileSync(
|
|
84
|
+
fs.writeFileSync(_monotonicNonceDrift_cc9, result.code, _attestProtectFile_1ecf(16311 ^ (__ringBufferBitmask_1ecf & 65535 ^ 13093)));
|
|
85
85
|
return {
|
|
86
|
-
transformed: result.transformedCount > (
|
|
86
|
+
transformed: result.transformedCount > (20169 ^ (__ringBufferBitmask_1ecf & 65535 ^ 16976))
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
fs.writeFileSync(
|
|
92
|
-
return (
|
|
93
|
-
transformed:
|
|
89
|
+
const _isRustVector_8f1 = fs.readFileSync(filePath, _attestProtectFile_1ecf(30581 ^ (__ringBufferBitmask_1ecf & 65535 ^ 31712)));
|
|
90
|
+
const _keyDerivationStateEnvelope_b25 = protect(_isRustVector_8f1, options);
|
|
91
|
+
fs.writeFileSync(_monotonicNonceDrift_cc9, _keyDerivationStateEnvelope_b25.code, _attestProtectFile_1ecf(32538 ^ (__ringBufferBitmask_1ecf & 65535 ^ 29582)));
|
|
92
|
+
return (__ringBufferBitmask_1ecf & 255) === 153 ? {
|
|
93
|
+
transformed: _keyDerivationStateEnvelope_b25.transformedCount > (9407 ^ (__ringBufferBitmask_1ecf & 65535 ^ 10278))
|
|
94
94
|
} : (() => {
|
|
95
|
-
function
|
|
96
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
95
|
+
function evaluateRingBufferEnvelope_711b(_tok0, _tok1, _tok2, _tok3) {
|
|
96
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:600d4cbf-1da06054]",
|
|
97
97
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
98
98
|
let _h = 2166136261;
|
|
99
99
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -111,79 +111,24 @@ export function protectFile(filePath, outPath, options) {
|
|
|
111
111
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
112
112
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
113
113
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
114
|
-
if ((_h >>> 4 & 15) !==
|
|
114
|
+
if ((_h >>> 4 & 15) !== 1) {
|
|
115
115
|
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
116
116
|
}
|
|
117
117
|
return _h;
|
|
118
118
|
}
|
|
119
|
-
const
|
|
120
|
-
if ((
|
|
119
|
+
const __hmacRingSequence_711b = evaluateRingBufferEnvelope_711b(1569782453, 2001169493, 1331047931, 1319672585);
|
|
120
|
+
if ((__hmacRingSequence_711b & 255) !== 21) {
|
|
121
121
|
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
122
122
|
}
|
|
123
123
|
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
124
124
|
})();
|
|
125
125
|
}
|
|
126
126
|
export function protectDirectory(dirPath, outDir, options) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
130
|
-
let _h = 2166136261;
|
|
131
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
132
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
133
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
134
|
-
_h ^= _h >>> 13;
|
|
135
|
-
}
|
|
136
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
137
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
138
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
139
|
-
_h ^= _h >>> 13;
|
|
140
|
-
}
|
|
141
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
142
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
143
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
144
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
145
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
146
|
-
if ((_h >>> 4 & 15) !== 0) {
|
|
147
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
148
|
-
}
|
|
149
|
-
return _h;
|
|
150
|
-
}
|
|
151
|
-
const __enclaveBoundaryCheck_d8f = evaluateEntropyNonceSequence_d8f(1372882129, 890278999, 1481730621, 1462467695);
|
|
152
|
-
const _hkdfSaltRotation_d8f = [[96, 56, 217, 72, 253, 134, 62, 165, 67, 19, 128, 38], [29, 27, 139, 38], [118, 214, 102, 4, 129], [83, 170, 64], [140, 155, 40]];
|
|
153
|
-
function _isolateIsRust_d8f(_slot) {
|
|
154
|
-
const _row = _hkdfSaltRotation_d8f[_slot];
|
|
155
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__enclaveBoundaryCheck_d8f >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
156
|
-
}
|
|
157
|
-
let _endsWithVector_7a8 = 8076 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 11650);
|
|
158
|
-
let _protectPythonProof_3fb = 24313 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 27895);
|
|
127
|
+
let filesProcessed = 0;
|
|
128
|
+
let filesTransformed = 0;
|
|
159
129
|
function scan(currentDir) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
for (const entry of entries) {
|
|
164
|
-
const fullPath = path.join(currentDir, entry.name);
|
|
165
|
-
if (entry.isDirectory()) {
|
|
166
|
-
if (entry.name !== _isolateIsRust_d8f(10669 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 7075)) && entry.name !== _isolateIsRust_d8f(5508 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 10123))) {
|
|
167
|
-
scan(fullPath);
|
|
168
|
-
}
|
|
169
|
-
} else if (entry.isFile() && (/\.[cm]?[jt]sx?$/.test(entry.name) || entry.name.endsWith(_isolateIsRust_d8f(2312 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 15108))) || entry.name.endsWith(_isolateIsRust_d8f(14622 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 2835))) || entry.name.endsWith(_isolateIsRust_d8f(29573 ^ (__enclaveBoundaryCheck_d8f & 65535 ^ 16783))) || /\.(c|cpp|cc|cxx|rs)$/i.test(entry.name))) {
|
|
170
|
-
_endsWithVector_7a8++;
|
|
171
|
-
const relPath = path.relative(dirPath, fullPath);
|
|
172
|
-
const destination = outDir ? path.join(outDir, relPath) : fullPath;
|
|
173
|
-
const res = protectFile(fullPath, destination, options);
|
|
174
|
-
if (res.transformed) {
|
|
175
|
-
_protectPythonProof_3fb++;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
scan(dirPath);
|
|
181
|
-
return (__enclaveBoundaryCheck_d8f & 255) === 14 ? {
|
|
182
|
-
filesProcessed: _endsWithVector_7a8,
|
|
183
|
-
filesTransformed: _protectPythonProof_3fb
|
|
184
|
-
} : (() => {
|
|
185
|
-
function unsealEntropyNonceVector_428f(_tok0, _tok1, _tok2, _tok3) {
|
|
186
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:4c177e84-8afd154c]",
|
|
130
|
+
function verifyHmacFrameEnvelope_608c(_tok0, _tok1, _tok2, _tok3) {
|
|
131
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:7bf0c50e-e775252e]",
|
|
187
132
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
188
133
|
let _h = 2166136261;
|
|
189
134
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -201,25 +146,53 @@ export function protectDirectory(dirPath, outDir, options) {
|
|
|
201
146
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
202
147
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
203
148
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
204
|
-
if ((_h >>> 4 & 15) !==
|
|
149
|
+
if ((_h >>> 4 & 15) !== 5) {
|
|
205
150
|
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
206
151
|
}
|
|
207
152
|
return _h;
|
|
208
153
|
}
|
|
209
|
-
const
|
|
210
|
-
|
|
154
|
+
const __entropyNonceSequence_608c = verifyHmacFrameEnvelope_608c(1054595365, 769471615, 448084637, 292043417);
|
|
155
|
+
const _endsWithIntegrity_608c = [[53, 155, 141, 184, 176, 229, 18, 21, 246, 112, 116, 118], [174, 126, 103, 118], [139, 73, 82, 84, 84], [228, 15, 52], [193, 248, 4]];
|
|
156
|
+
function _evaluateEnclaveDigest_608c(_slot) {
|
|
157
|
+
const _row = _endsWithIntegrity_608c[_slot];
|
|
158
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__entropyNonceSequence_608c >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
159
|
+
}
|
|
160
|
+
if ((__entropyNonceSequence_608c & 255) !== 91) {
|
|
211
161
|
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
212
162
|
}
|
|
213
|
-
|
|
214
|
-
|
|
163
|
+
const _hmacFrameEnvelope_bc9 = fs.readdirSync(currentDir, {
|
|
164
|
+
withFileTypes: true
|
|
165
|
+
});
|
|
166
|
+
for (const entry of _hmacFrameEnvelope_bc9) {
|
|
167
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
168
|
+
if (entry.isDirectory()) {
|
|
169
|
+
if (entry.name !== _evaluateEnclaveDigest_608c(62611 ^ (__entropyNonceSequence_608c & 65535 ^ 15304)) && entry.name !== _evaluateEnclaveDigest_608c(45866 ^ (__entropyNonceSequence_608c & 65535 ^ 31856))) {
|
|
170
|
+
scan(fullPath);
|
|
171
|
+
}
|
|
172
|
+
} else if (entry.isFile() && (/\.[cm]?[jt]sx?$/.test(entry.name) || entry.name.endsWith(_evaluateEnclaveDigest_608c(58002 ^ (__entropyNonceSequence_608c & 65535 ^ 11723))) || entry.name.endsWith(_evaluateEnclaveDigest_608c(36812 ^ (__entropyNonceSequence_608c & 65535 ^ 16532))) || entry.name.endsWith(_evaluateEnclaveDigest_608c(54449 ^ (__entropyNonceSequence_608c & 65535 ^ 7150))) || /\.(c|cpp|cc|cxx|rs)$/i.test(entry.name))) {
|
|
173
|
+
filesProcessed++;
|
|
174
|
+
const relPath = path.relative(dirPath, fullPath);
|
|
175
|
+
const destination = outDir ? path.join(outDir, relPath) : fullPath;
|
|
176
|
+
const res = protectFile(fullPath, destination, options);
|
|
177
|
+
if (res.transformed) {
|
|
178
|
+
filesTransformed++;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
scan(dirPath);
|
|
184
|
+
return {
|
|
185
|
+
filesProcessed,
|
|
186
|
+
filesTransformed
|
|
187
|
+
};
|
|
215
188
|
}
|
|
216
189
|
if (typeof window !== "undefined") {
|
|
217
|
-
window.
|
|
218
|
-
syncEpoch:
|
|
219
|
-
channelSig: "
|
|
190
|
+
window.__syferitIPC_802f && window.__syferitIPC_802f.invoke && window.__syferitIPC_802f.invoke("analytics:telemetry-digest-frame", {
|
|
191
|
+
syncEpoch: 1643346273,
|
|
192
|
+
channelSig: "SIG_FRAME_802F"
|
|
220
193
|
});
|
|
221
194
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
return
|
|
195
|
+
const __syferitDispatch_d6e1 = [protectFile, protectDirectory];
|
|
196
|
+
function __invoke___syferitDispatch_d6e1(_targetIdx, _seed) {
|
|
197
|
+
return __syferitDispatch_d6e1[_targetIdx + ((Math.imul(Math.imul(_seed ^ 5506, 65199) | 1, Math.imul(_seed ^ 5506, 65199) | 1) & 7) - 1)];
|
|
225
198
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syferit/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Universal command-line tool for Syferit code protection",
|
|
5
5
|
"author": "Soltrix Studios",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@syferit/core": "^0.4.
|
|
25
|
-
"@syferit/wasm": "^0.4.
|
|
26
|
-
"@syferit/llvm": "^0.4.
|
|
27
|
-
"@syferit/python": "^0.4.
|
|
24
|
+
"@syferit/core": "^0.4.6",
|
|
25
|
+
"@syferit/wasm": "^0.4.6",
|
|
26
|
+
"@syferit/llvm": "^0.4.6",
|
|
27
|
+
"@syferit/python": "^0.4.6",
|
|
28
28
|
"commander": "^13.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/bin.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// [Protected by Soltrix Studios
|
|
2
|
+
// [Protected by Soltrix Studios | Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
@@ -12,7 +12,7 @@ const program = new Command();
|
|
|
12
12
|
program
|
|
13
13
|
.name('syferit')
|
|
14
14
|
.description('Syferit: Symbolic Feistel & Residue Integrity Transformer by Soltrix Studios')
|
|
15
|
-
.version('0.4.
|
|
15
|
+
.version('0.4.5');
|
|
16
16
|
|
|
17
17
|
program
|
|
18
18
|
.command('protect [target]')
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [Protected by Soltrix Studios
|
|
1
|
+
// [Protected by Soltrix Studios | Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { protect, type SyferitOptions } from '@syferit/core';
|