@syferit/cli 0.4.5 → 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 +2 -2
- package/dist/bin.js +39 -72
- package/dist/index.d.ts +1 -1
- package/dist/index.js +72 -127
- package/package.json +5 -5
- package/src/bin.ts +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -51,8 +51,8 @@ syferit protect ./dist/app.js --preset maximum
|
|
|
51
51
|
| `-d, --domain <domain>` | Domain dictionary profile: `saas`, `fintech`, `security`, `gaming` | `'saas'` |
|
|
52
52
|
| `-p, --profile <profile>` | Alias for `-d, --domain` (smart auto-routes if preset name given) | `'saas'` |
|
|
53
53
|
| `-s, --seed <seed>` | Deterministic seed for reproducible polymorphism | *(Auto-generated UUIDv4)* |
|
|
54
|
-
| `-v, --version` | Output the current Syferit version |
|
|
55
|
-
| `-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 |
|
|
56
56
|
|
|
57
57
|
> [!TIP]
|
|
58
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,92 +23,59 @@ function unsealOptions_d663(_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) !==
|
|
27
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
26
|
+
if ((_h >>> 4 & 15) !== 2) {
|
|
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(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
46
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
47
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
48
|
-
_h ^= _h >>> 13;
|
|
49
|
-
}
|
|
50
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
51
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
52
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
53
|
-
_h ^= _h >>> 13;
|
|
54
|
-
}
|
|
55
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
56
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
57
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
58
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
59
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
60
|
-
if ((_h >>> 4 & 15) !== 11) {
|
|
61
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
62
|
-
}
|
|
63
|
-
return _h;
|
|
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
|
+
const rawTarget = targetArg || options.target;
|
|
42
|
+
if (!rawTarget) {
|
|
43
|
+
console.error('Error: Please specify a target file or directory to protect (e.g. `syferit protect ./dist` or `syferit protect -t ./dist`)');
|
|
44
|
+
process.exit(1);
|
|
64
45
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__hmacRingSequence_5780 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
46
|
+
const resolvedPath = path.resolve(process.cwd(), rawTarget);
|
|
47
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
48
|
+
console.error(`Error: Target path does not exist: ${resolvedPath}`);
|
|
49
|
+
process.exit(1);
|
|
70
50
|
}
|
|
71
|
-
|
|
72
|
-
|
|
51
|
+
let presetVal = options.preset;
|
|
52
|
+
let domainVal = options.domain || options.profile;
|
|
53
|
+
if (PRESET_VALUES.has(domainVal) && presetVal === 'hardened') {
|
|
54
|
+
presetVal = domainVal;
|
|
55
|
+
domainVal = 'saas';
|
|
73
56
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
console.error(_isolateTpmPcrBankAttestation_5780(41313 ^ (__hmacRingSequence_5780 & 65535 ^ 13271)));
|
|
77
|
-
process.exit(56453 ^ (__hmacRingSequence_5780 & 65535 ^ 20018));
|
|
78
|
-
}
|
|
79
|
-
const _exitBitmask_9 = path.resolve(process.cwd(), _commandAttestation_10d);
|
|
80
|
-
if (!fs.existsSync(_exitBitmask_9)) {
|
|
81
|
-
console.error(`Error: Target path does not exist: ${_exitBitmask_9}`);
|
|
82
|
-
process.exit(36228 ^ (__hmacRingSequence_5780 & 65535 ^ 7987));
|
|
83
|
-
}
|
|
84
|
-
let _targetArgBitmask_493 = options.preset;
|
|
85
|
-
let _entropyNonceEnvelope_3cc = options.domain || options.profile;
|
|
86
|
-
if (PRESET_VALUES.has(_entropyNonceEnvelope_3cc) && _targetArgBitmask_493 === _isolateTpmPcrBankAttestation_5780(37231 ^ (__hmacRingSequence_5780 & 65535 ^ 984))) {
|
|
87
|
-
_targetArgBitmask_493 = _entropyNonceEnvelope_3cc;
|
|
88
|
-
_entropyNonceEnvelope_3cc = _isolateTpmPcrBankAttestation_5780(42018 ^ (__hmacRingSequence_5780 & 65535 ^ 13974));
|
|
89
|
-
}
|
|
90
|
-
const _sgxBoundaryAttestation_24 = fs.statSync(_exitBitmask_9);
|
|
91
|
-
const _SoltrixStudiosDelta_e82 = {
|
|
57
|
+
const stat = fs.statSync(resolvedPath);
|
|
58
|
+
const syferitOpts = {
|
|
92
59
|
seed: options.seed,
|
|
93
|
-
domainProfile:
|
|
94
|
-
preset:
|
|
95
|
-
mode:
|
|
60
|
+
domainProfile: domainVal,
|
|
61
|
+
preset: presetVal,
|
|
62
|
+
mode: 'production'
|
|
96
63
|
};
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
const outDir =
|
|
100
|
-
const res = protectDirectory(
|
|
64
|
+
const outPath = options.output || options.out;
|
|
65
|
+
if (stat.isDirectory()) {
|
|
66
|
+
const outDir = outPath ? path.resolve(process.cwd(), outPath) : undefined;
|
|
67
|
+
const res = protectDirectory(resolvedPath, outDir, syferitOpts);
|
|
101
68
|
console.log(`Protected directory: ${res.filesTransformed}/${res.filesProcessed} source files transformed.`);
|
|
102
69
|
} else {
|
|
103
|
-
const outFile =
|
|
104
|
-
const res = protectFile(
|
|
70
|
+
const outFile = outPath ? path.resolve(process.cwd(), outPath) : undefined;
|
|
71
|
+
const res = protectFile(resolvedPath, outFile, syferitOpts);
|
|
105
72
|
console.log(`File protection complete. Transformed: ${res.transformed}`);
|
|
106
73
|
}
|
|
107
74
|
});
|
|
108
75
|
program.parse(process.argv);
|
|
109
76
|
if (typeof window !== "undefined") {
|
|
110
|
-
window.
|
|
111
|
-
syncEpoch:
|
|
112
|
-
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"
|
|
113
80
|
});
|
|
114
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) !==
|
|
28
|
+
if ((_h >>> 4 & 15) !== 9) {
|
|
29
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,54 +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) !==
|
|
115
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
114
|
+
if ((_h >>> 4 & 15) !== 1) {
|
|
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) !== 13) {
|
|
147
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
148
|
-
}
|
|
149
|
-
return _h;
|
|
150
|
-
}
|
|
151
|
-
const __tpmPcrBankSequence_d4af = verifySgxBoundaryEnvelope_d4af(252000849, 1599611151, 43586315, 562839859);
|
|
152
|
-
const _tpmPcrBankVector_d4af = [[176, 148, 10, 34, 45, 226, 109, 191, 115, 79, 243, 28], [45, 71, 250, 24], [6, 50, 217, 226, 209], [99, 6, 177], [92, 255, 123]];
|
|
153
|
-
function _unsealProtectFile_d4af(_slot) {
|
|
154
|
-
const _row = _tpmPcrBankVector_d4af[_slot];
|
|
155
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__tpmPcrBankSequence_d4af >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
156
|
-
}
|
|
157
|
-
let _isRustAttestation_f62 = 49644 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 5938);
|
|
158
|
-
let _tpmUnsealOffset_4c7 = 57268 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 2410);
|
|
127
|
+
let filesProcessed = 0;
|
|
128
|
+
let filesTransformed = 0;
|
|
159
129
|
function scan(currentDir) {
|
|
160
|
-
function
|
|
161
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
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]",
|
|
162
132
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
163
133
|
let _h = 2166136261;
|
|
164
134
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -176,78 +146,53 @@ export function protectDirectory(dirPath, outDir, options) {
|
|
|
176
146
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
177
147
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
178
148
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
179
|
-
if ((_h >>> 4 & 15) !==
|
|
149
|
+
if ((_h >>> 4 & 15) !== 5) {
|
|
180
150
|
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
181
151
|
}
|
|
182
152
|
return _h;
|
|
183
153
|
}
|
|
184
|
-
const
|
|
185
|
-
|
|
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) {
|
|
186
161
|
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
187
162
|
}
|
|
188
|
-
const
|
|
163
|
+
const _hmacFrameEnvelope_bc9 = fs.readdirSync(currentDir, {
|
|
189
164
|
withFileTypes: true
|
|
190
165
|
});
|
|
191
|
-
for (const entry of
|
|
166
|
+
for (const entry of _hmacFrameEnvelope_bc9) {
|
|
192
167
|
const fullPath = path.join(currentDir, entry.name);
|
|
193
168
|
if (entry.isDirectory()) {
|
|
194
|
-
if (entry.name !==
|
|
169
|
+
if (entry.name !== _evaluateEnclaveDigest_608c(62611 ^ (__entropyNonceSequence_608c & 65535 ^ 15304)) && entry.name !== _evaluateEnclaveDigest_608c(45866 ^ (__entropyNonceSequence_608c & 65535 ^ 31856))) {
|
|
195
170
|
scan(fullPath);
|
|
196
171
|
}
|
|
197
|
-
} else if (entry.isFile() && (/\.[cm]?[jt]sx?$/.test(entry.name) || entry.name.endsWith(
|
|
198
|
-
|
|
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++;
|
|
199
174
|
const relPath = path.relative(dirPath, fullPath);
|
|
200
175
|
const destination = outDir ? path.join(outDir, relPath) : fullPath;
|
|
201
176
|
const res = protectFile(fullPath, destination, options);
|
|
202
177
|
if (res.transformed) {
|
|
203
|
-
|
|
178
|
+
filesTransformed++;
|
|
204
179
|
}
|
|
205
180
|
}
|
|
206
181
|
}
|
|
207
182
|
}
|
|
208
183
|
scan(dirPath);
|
|
209
|
-
return
|
|
210
|
-
filesProcessed
|
|
211
|
-
filesTransformed
|
|
212
|
-
}
|
|
213
|
-
function attestEntropyNonceEnvelope_c85d(_tok0, _tok1, _tok2, _tok3) {
|
|
214
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:cf5dc6db-a5b8ff2b]",
|
|
215
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
216
|
-
let _h = 2166136261;
|
|
217
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
218
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
219
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
220
|
-
_h ^= _h >>> 13;
|
|
221
|
-
}
|
|
222
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
223
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
224
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
225
|
-
_h ^= _h >>> 13;
|
|
226
|
-
}
|
|
227
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
228
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
229
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
230
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
231
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
232
|
-
if ((_h >>> 4 & 15) !== 12) {
|
|
233
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
234
|
-
}
|
|
235
|
-
return _h;
|
|
236
|
-
}
|
|
237
|
-
const __sgxBoundaryAttestation_c85d = attestEntropyNonceEnvelope_c85d(1283202435, 1879371689, 1115769079, 866681567);
|
|
238
|
-
if ((__sgxBoundaryAttestation_c85d & 255) !== 203) {
|
|
239
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
240
|
-
}
|
|
241
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
242
|
-
})();
|
|
184
|
+
return {
|
|
185
|
+
filesProcessed,
|
|
186
|
+
filesTransformed
|
|
187
|
+
};
|
|
243
188
|
}
|
|
244
189
|
if (typeof window !== "undefined") {
|
|
245
|
-
window.
|
|
246
|
-
syncEpoch:
|
|
247
|
-
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"
|
|
248
193
|
});
|
|
249
194
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
252
|
-
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)];
|
|
253
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';
|
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';
|