@syferit/cli 0.4.4 → 0.4.5
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 +11 -4
- package/dist/bin.js +71 -38
- package/dist/index.js +104 -76
- package/package.json +5 -5
- package/src/bin.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
|
|
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 unsealOptions_d663(_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:537f4518-1c5e46b5]",
|
|
9
9
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
10
10
|
let _h = 2166136261;
|
|
11
11
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -24,58 +24,91 @@ function auditTpmPcrBankAttestation_c709(_tok0, _tok1, _tok2, _tok3) {
|
|
|
24
24
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
25
25
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
26
26
|
if ((_h >>> 4 & 15) !== 0) {
|
|
27
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
27
|
+
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
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 __tpmPcrBankAttestation_d663 = unsealOptions_d663(1707218903, 1620708255, 209889719, 1461442083);
|
|
32
|
+
const _PRESET_VALUESIntegrity_d663 = [[113, 155, 132, 31, 242, 226, 11, 97], [79, 117, 120, 242, 222, 198, 251, 78], [33, 88, 87, 210, 141, 184, 174], [2, 39, 50, 133, 119, 155, 156], [197, 250, 31, 96, 88, 126, 121, 163, 158, 248, 216, 64, 48, 80, 89, 168, 133, 243, 143, 48, 19, 20, 41, 140, 98, 219, 215, 93, 240, 234, 246, 120, 82, 86, 124, 133, 131, 217, 217, 92, 57, 57, 40, 185, 139, 255, 129, 19, 231, 29, 26, 147, 117, 117, 144, 236, 220, 187, 243, 100, 98, 124, 74, 221, 162, 177, 208, 61, 74, 4, 57, 172, 154, 130, 142, 30], [139, 134, 170, 4, 122], [144, 191, 172, 59, 17, 2, 35, 195, 83, 129, 138, 5, 251, 236, 11, 86], [68, 130, 152, 24, 224, 166, 61, 91, 121, 58, 124, 243, 166, 199, 199, 16, 48, 44, 76, 165, 135, 177, 160, 61, 16, 15, 14, 152, 49, 159, 154, 228, 133, 225, 237, 121, 88, 72, 104, 193, 174, 154, 192, 78, 14, 58, 33, 179, 129, 139, 183, 10, 169, 2, 3, 216, 124, 42, 102, 229, 221, 251, 180, 79, 55, 18, 76, 221, 171, 163, 223, 60, 2, 40, 41], [7, 99, 33, 185, 147, 134, 213, 76, 32, 88, 80, 181, 198, 239, 185, 52, 14, 15, 99], [31, 93, 70, 214, 195, 164, 169, 114, 17, 13, 54, 131, 43, 151, 156, 90, 251, 229, 240, 107, 80, 84, 121, 208, 190, 148, 222, 89, 123, 56, 76, 165, 155, 185, 177, 42], [89, 14, 123, 195, 37, 216, 132, 2, 232, 169, 67, 123, 81, 105, 123, 161], [221, 227, 15, 124, 68, 116, 113, 232, 168, 193, 202, 16, 58, 55, 76, 180, 156, 162, 236, 40, 28, 30, 8, 204, 57, 154, 145, 230, 196, 231, 228, 96, 74, 6, 104, 199, 237, 211, 222, 17, 17, 34, 37, 179, 144, 194, 183, 18, 236, 4, 27, 138, 116, 126, 101, 165], [147, 134, 206, 88, 38, 79, 64, 181, 198, 239, 185, 52, 14, 15, 99], [162, 188, 175, 51, 4, 68, 60, 137, 121, 216, 195, 21, 179, 172, 175, 35, 92, 85, 98], [37, 216, 155, 5, 249, 250, 26, 127, 16, 33, 99, 237, 161, 194, 194, 71, 102], [125, 104, 127, 232, 164, 205, 208, 89, 58, 44, 24, 168, 140, 160, 169, 52, 71, 74, 19, 152, 112, 144, 144, 225, 215, 246, 164, 52, 81, 71, 110, 204, 168, 212, 213, 88, 77, 110, 43, 162, 213, 143, 185, 28, 224, 27, 25, 149], [58, 94, 71, 165, 131, 189, 172, 49], [90, 20, 118, 198, 38, 213, 158, 8, 240, 234, 235, 98, 86, 0, 42, 210, 181, 219, 204, 95, 55, 45, 0], [216, 230, 18, 106, 89, 115, 51, 251, 173, 210, 211, 90, 55, 43, 90, 181, 149, 249, 191, 41, 239, 11, 10, 131, 113, 33, 223, 240, 201, 244, 248, 59, 28, 79, 118, 197, 164, 216, 208, 87, 72, 113, 52, 182, 155, 144, 169, 14, 248, 0, 67, 219, 71, 108, 110, 230, 218, 198, 190], [178, 207, 197, 67], [203, 183, 229, 117, 87, 74, 57, 134, 99, 154, 152, 19, 130, 179, 225, 126, 91, 66, 112, 203, 244], [74, 148, 135, 27, 236, 172, 228, 97, 65, 0, 59, 210, 235, 148, 135, 27, 43, 58, 81, 172, 134, 176, 183], [29, 110, 63, 191, 233, 156, 212, 86, 61, 33, 27, 251, 159, 188, 170, 63, 190], [17, 39, 76, 161, 155, 187, 165, 54, 20, 25, 20, 133, 114, 222, 150, 245, 204, 254, 236, 52, 74, 67, 121, 204, 237, 220, 223, 78, 65, 60, 33, 160, 135, 141, 188, 17, 234, 31, 14, 148, 120, 42, 112, 227, 221, 231, 249, 79, 55, 66, 64, 221, 170, 171]];
|
|
33
|
+
function _auditTpmPcrBankIntegrity_d663(_slot) {
|
|
34
|
+
const _row = _PRESET_VALUESIntegrity_d663[_slot];
|
|
35
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__tpmPcrBankAttestation_d663 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
36
36
|
}
|
|
37
|
-
const PRESET_VALUES = new Set([
|
|
37
|
+
const PRESET_VALUES = new Set([_auditTpmPcrBankIntegrity_d663(52027 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 313)), _auditTpmPcrBankIntegrity_d663(33082 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 19257)), _auditTpmPcrBankIntegrity_d663(56075 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 4363))]);
|
|
38
38
|
const program = new Command();
|
|
39
|
-
program.name(
|
|
40
|
-
program.command(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
program.name(_auditTpmPcrBankIntegrity_d663(36778 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 17835))).description(_auditTpmPcrBankIntegrity_d663(57644 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 11050))).version(_auditTpmPcrBankIntegrity_d663(43908 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 24963)));
|
|
40
|
+
program.command(_auditTpmPcrBankIntegrity_d663(60496 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 9812))).description(_auditTpmPcrBankIntegrity_d663(44909 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 25960))).option(_auditTpmPcrBankIntegrity_d663(55191 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 7581)), _auditTpmPcrBankIntegrity_d663(35466 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 16513))).option(_auditTpmPcrBankIntegrity_d663(33378 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 18538)), _auditTpmPcrBankIntegrity_d663(58328 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 10705))).option(_auditTpmPcrBankIntegrity_d663(36891 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 23061)), _auditTpmPcrBankIntegrity_d663(49856 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 2255))).option(_auditTpmPcrBankIntegrity_d663(33301 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 18457)), _auditTpmPcrBankIntegrity_d663(60599 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 9914)), _auditTpmPcrBankIntegrity_d663(61337 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 9611))).option(_auditTpmPcrBankIntegrity_d663(62809 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 16202)), _auditTpmPcrBankIntegrity_d663(47191 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 29255)), _auditTpmPcrBankIntegrity_d663(51076 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 3477))).option(_auditTpmPcrBankIntegrity_d663(50122 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 2524)), _auditTpmPcrBankIntegrity_d663(51624 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 959))).option(_auditTpmPcrBankIntegrity_d663(61510 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 14930)), _auditTpmPcrBankIntegrity_d663(52770 ^ (__tpmPcrBankAttestation_d663 & 65535 ^ 1079))).action((targetArg, options) => {
|
|
41
|
+
function unsealOptions_5780(_tok0, _tok1, _tok2, _tok3) {
|
|
42
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:5c9a027d-66477610]",
|
|
43
|
+
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
44
|
+
let _h = 2166136261;
|
|
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;
|
|
45
64
|
}
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
const __hmacRingSequence_5780 = unsealOptions_5780(1782584013, 2112226255, 1229685587, 1080607517);
|
|
66
|
+
const _pcrPolicyBitmask_5780 = [[243, 197, 247, 238, 56, 113, 57, 69, 178, 186, 204, 218, 23, 83, 50, 77, 99, 100, 188, 183, 227, 187, 8, 69, 90, 78, 143, 158, 167, 183, 177, 235, 63, 59, 64, 1, 133, 153, 153, 209, 23, 13, 40, 42, 102, 124, 147, 164, 134, 211, 26, 81, 74, 73, 102, 113, 171, 172, 233, 185, 74, 6, 31, 74, 216, 215, 165, 178, 243, 237, 60, 39, 119, 107, 205, 153, 192, 220, 245, 24, 37, 51, 53, 63, 245, 191, 192, 214, 26, 15, 29, 86, 112, 35, 177, 190, 239, 241, 0, 19, 67, 95, 217, 133, 204, 208, 249, 236, 49, 39, 1, 48, 146, 199, 155, 158, 30, 18, 58, 49, 110, 38], [179, 189, 216, 194, 10, 30, 91, 94], [115, 96, 174, 184], [85, 84, 155, 148, 204, 217, 252, 237, 34, 32], [44, 34, 105, 102, 129, 238, 153, 153, 45, 64, 30, 78, 114, 117, 188, 178, 238], [10, 30, 93, 86, 98, 114, 183, 145, 254, 235, 9, 14, 74, 88, 159, 146]];
|
|
67
|
+
function _isolateTpmPcrBankAttestation_5780(_slot) {
|
|
68
|
+
const _row = _pcrPolicyBitmask_5780[_slot];
|
|
69
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__hmacRingSequence_5780 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
50
70
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (PRESET_VALUES.has(domainVal) && presetVal === 'hardened') {
|
|
54
|
-
presetVal = domainVal;
|
|
55
|
-
domainVal = 'saas';
|
|
71
|
+
if ((__hmacRingSequence_5780 & 255) !== 182) {
|
|
72
|
+
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
56
73
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
74
|
+
const _commandAttestation_10d = targetArg || options.target;
|
|
75
|
+
if (!_commandAttestation_10d) {
|
|
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 = {
|
|
59
92
|
seed: options.seed,
|
|
60
|
-
domainProfile:
|
|
61
|
-
preset:
|
|
62
|
-
mode:
|
|
93
|
+
domainProfile: _entropyNonceEnvelope_3cc,
|
|
94
|
+
preset: _targetArgBitmask_493,
|
|
95
|
+
mode: _isolateTpmPcrBankAttestation_5780(58200 ^ (__hmacRingSequence_5780 & 65535 ^ 29165))
|
|
63
96
|
};
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const outDir =
|
|
67
|
-
const res = protectDirectory(
|
|
97
|
+
const _nameVector_eb9 = options.output || options.out;
|
|
98
|
+
if (_sgxBoundaryAttestation_24.isDirectory()) {
|
|
99
|
+
const outDir = _nameVector_eb9 ? path.resolve(process.cwd(), _nameVector_eb9) : undefined;
|
|
100
|
+
const res = protectDirectory(_exitBitmask_9, outDir, _SoltrixStudiosDelta_e82);
|
|
68
101
|
console.log(`Protected directory: ${res.filesTransformed}/${res.filesProcessed} source files transformed.`);
|
|
69
102
|
} else {
|
|
70
|
-
const outFile =
|
|
71
|
-
const res = protectFile(
|
|
103
|
+
const outFile = _nameVector_eb9 ? path.resolve(process.cwd(), _nameVector_eb9) : undefined;
|
|
104
|
+
const res = protectFile(_exitBitmask_9, outFile, _SoltrixStudiosDelta_e82);
|
|
72
105
|
console.log(`File protection complete. Transformed: ${res.transformed}`);
|
|
73
106
|
}
|
|
74
107
|
});
|
|
75
108
|
program.parse(process.argv);
|
|
76
109
|
if (typeof window !== "undefined") {
|
|
77
|
-
window.
|
|
78
|
-
syncEpoch:
|
|
79
|
-
channelSig: "
|
|
110
|
+
window.__syferitIPC_f497.invoke && window.__syferitIPC_f497.invoke("hardware:monotonic-clock-sync", {
|
|
111
|
+
syncEpoch: 1083349730,
|
|
112
|
+
channelSig: "SIG_FRAME_F497"
|
|
80
113
|
});
|
|
81
114
|
}
|
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 isolateIsRust_4ca5(_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:454bcf2e-825b6f80]",
|
|
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) !== 12) {
|
|
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 __tpmPcrBankBitmask_4ca5 = isolateIsRust_4ca5(1166770725, 1415239733, 383130945, 1195919927);
|
|
34
|
+
const _isWasmAttestation_4ca5 = [[228, 162, 224, 187, 51], [193, 150, 202], [58, 109, 184], [23, 52, 137], [43, 29, 115, 113, 202], [246, 250, 92, 172, 47], [221, 199, 57, 139, 4], [191, 173, 247, 191], [145, 141, 217], [98, 86, 168, 56, 147], [73, 51, 149, 23, 232], [20, 24, 126, 114, 205], [243, 229, 91, 169, 34], [222, 194, 4, 132, 7]];
|
|
35
|
+
function _isolateKeyDerivationStateProof_4ca5(_slot) {
|
|
36
|
+
const _row = _isWasmAttestation_4ca5[_slot];
|
|
37
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__tpmPcrBankBitmask_4ca5 >>> (_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 _endsWithEnvelope_c33 = filePath.endsWith(_isolateKeyDerivationStateProof_4ca5(52519 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 32237)));
|
|
40
|
+
const _sgxBoundaryBitmask_155 = filePath.endsWith(_isolateKeyDerivationStateProof_4ca5(53219 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 32552)));
|
|
41
|
+
const _testIntegrity_2d0 = filePath.endsWith(_isolateKeyDerivationStateProof_4ca5(50713 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 30417)));
|
|
42
|
+
const _monotonicNonceDrift_afe = /\.(c|cpp|cc|cxx)$/i.test(filePath);
|
|
43
|
+
const _sgxBoundaryProof_84e = filePath.endsWith(_isolateKeyDerivationStateProof_4ca5(43477 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 6428)));
|
|
44
|
+
const _destDirBitmask_a2d = outPath || filePath;
|
|
45
|
+
const _pcrPolicyBitmask_4c6 = path.dirname(_destDirBitmask_a2d);
|
|
46
|
+
if (!fs.existsSync(_pcrPolicyBitmask_4c6)) {
|
|
47
|
+
fs.mkdirSync(_pcrPolicyBitmask_4c6, {
|
|
48
48
|
recursive: true
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (_endsWithEnvelope_c33) {
|
|
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(_destDirBitmask_a2d, result.binary);
|
|
58
58
|
return {
|
|
59
|
-
transformed: result.sectionsProtected > (
|
|
59
|
+
transformed: result.sectionsProtected > (33037 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 12743))
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
const irCode = fs.readFileSync(filePath,
|
|
62
|
+
if (_sgxBoundaryBitmask_155) {
|
|
63
|
+
const irCode = fs.readFileSync(filePath, _isolateKeyDerivationStateProof_4ca5(44729 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 7799)));
|
|
64
64
|
const result = protectLlvmIr(irCode, options);
|
|
65
|
-
fs.writeFileSync(
|
|
65
|
+
fs.writeFileSync(_destDirBitmask_a2d, result.code, _isolateKeyDerivationStateProof_4ca5(65032 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 20167)));
|
|
66
66
|
return {
|
|
67
|
-
transformed: result.transformedCount > (
|
|
67
|
+
transformed: result.transformedCount > (47776 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 2666))
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
71
|
-
const srcCode = fs.readFileSync(filePath,
|
|
70
|
+
if (_testIntegrity_2d0 || _monotonicNonceDrift_afe) {
|
|
71
|
+
const srcCode = fs.readFileSync(filePath, _isolateKeyDerivationStateProof_4ca5(64230 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 18986)));
|
|
72
72
|
const result = protectNativeSource(srcCode, {
|
|
73
73
|
...options,
|
|
74
|
-
targetLanguage:
|
|
74
|
+
targetLanguage: _testIntegrity_2d0 ? _isolateKeyDerivationStateProof_4ca5(44142 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 7331)) : _isolateKeyDerivationStateProof_4ca5(40761 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 12283))
|
|
75
75
|
});
|
|
76
|
-
fs.writeFileSync(
|
|
76
|
+
fs.writeFileSync(_destDirBitmask_a2d, result.code, _isolateKeyDerivationStateProof_4ca5(63060 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 18071)));
|
|
77
77
|
return {
|
|
78
|
-
transformed: result.transformedCount > (
|
|
78
|
+
transformed: result.transformedCount > (48523 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 3393))
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
82
|
-
const pyCode = fs.readFileSync(filePath,
|
|
81
|
+
if (_sgxBoundaryProof_84e) {
|
|
82
|
+
const pyCode = fs.readFileSync(filePath, _isolateKeyDerivationStateProof_4ca5(48794 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 3674)));
|
|
83
83
|
const result = protectPython(pyCode, options);
|
|
84
|
-
fs.writeFileSync(
|
|
84
|
+
fs.writeFileSync(_destDirBitmask_a2d, result.code, _isolateKeyDerivationStateProof_4ca5(46467 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 1346)));
|
|
85
85
|
return {
|
|
86
|
-
transformed: result.transformedCount > (
|
|
86
|
+
transformed: result.transformedCount > (46377 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 1507))
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
fs.writeFileSync(
|
|
92
|
-
return (
|
|
93
|
-
transformed:
|
|
89
|
+
const _protectLlvmIrProof_ce0 = fs.readFileSync(filePath, _isolateKeyDerivationStateProof_4ca5(39806 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 11192)));
|
|
90
|
+
const _destinationProof_dd4 = protect(_protectLlvmIrProof_ce0, options);
|
|
91
|
+
fs.writeFileSync(_destDirBitmask_a2d, _destinationProof_dd4.code, _isolateKeyDerivationStateProof_4ca5(41521 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 4854)));
|
|
92
|
+
return (__tpmPcrBankBitmask_4ca5 & 255) === 202 ? {
|
|
93
|
+
transformed: _destinationProof_dd4.transformedCount > (59573 ^ (__tpmPcrBankBitmask_4ca5 & 65535 ^ 22655))
|
|
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 verifySyferitEngineContext_1f43(_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:66508597-6ce1d128]",
|
|
97
97
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
98
98
|
let _h = 2166136261;
|
|
99
99
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -111,21 +111,21 @@ 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) !== 6) {
|
|
115
|
+
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
116
116
|
}
|
|
117
117
|
return _h;
|
|
118
118
|
}
|
|
119
|
-
const
|
|
120
|
-
if ((
|
|
119
|
+
const __sgxBoundaryAttestation_1f43 = verifySyferitEngineContext_1f43(1502346093, 1965397161, 624131763, 1420996771);
|
|
120
|
+
if ((__sgxBoundaryAttestation_1f43 & 255) !== 98) {
|
|
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
|
-
function
|
|
128
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
127
|
+
function verifySgxBoundaryEnvelope_d4af(_tok0, _tok1, _tok2, _tok3) {
|
|
128
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:d2fd3f58-7c27c93a]",
|
|
129
129
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
130
130
|
let _h = 2166136261;
|
|
131
131
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -143,47 +143,75 @@ export function protectDirectory(dirPath, outDir, options) {
|
|
|
143
143
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
144
144
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
145
145
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
146
|
-
if ((_h >>> 4 & 15) !==
|
|
146
|
+
if ((_h >>> 4 & 15) !== 13) {
|
|
147
147
|
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
148
148
|
}
|
|
149
149
|
return _h;
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
function
|
|
154
|
-
const _row =
|
|
155
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (
|
|
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
156
|
}
|
|
157
|
-
let
|
|
158
|
-
let
|
|
157
|
+
let _isRustAttestation_f62 = 49644 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 5938);
|
|
158
|
+
let _tpmUnsealOffset_4c7 = 57268 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 2410);
|
|
159
159
|
function scan(currentDir) {
|
|
160
|
-
|
|
160
|
+
function rotateTpmPcrBankVector_d25f(_tok0, _tok1, _tok2, _tok3) {
|
|
161
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:a24da7c9-059b1cfb]",
|
|
162
|
+
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
163
|
+
let _h = 2166136261;
|
|
164
|
+
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
165
|
+
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
166
|
+
_h = Math.imul(_h, 16777619) >>> 0;
|
|
167
|
+
_h ^= _h >>> 13;
|
|
168
|
+
}
|
|
169
|
+
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
170
|
+
_h ^= _legalAttestation.charCodeAt(_i);
|
|
171
|
+
_h = Math.imul(_h, 16777619) >>> 0;
|
|
172
|
+
_h ^= _h >>> 13;
|
|
173
|
+
}
|
|
174
|
+
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
175
|
+
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
176
|
+
_h = (_h ^ _h >>> 16) >>> 0;
|
|
177
|
+
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
178
|
+
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
179
|
+
if ((_h >>> 4 & 15) !== 12) {
|
|
180
|
+
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
181
|
+
}
|
|
182
|
+
return _h;
|
|
183
|
+
}
|
|
184
|
+
const __entropySeedDigest_d25f = rotateTpmPcrBankVector_d25f(519646333, 2031940667, 379078157, 1681504391);
|
|
185
|
+
if ((__entropySeedDigest_d25f & 255) !== 194) {
|
|
186
|
+
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
187
|
+
}
|
|
188
|
+
const _isCCppSequence_77e = fs.readdirSync(currentDir, {
|
|
161
189
|
withFileTypes: true
|
|
162
190
|
});
|
|
163
|
-
for (const entry of
|
|
191
|
+
for (const entry of _isCCppSequence_77e) {
|
|
164
192
|
const fullPath = path.join(currentDir, entry.name);
|
|
165
193
|
if (entry.isDirectory()) {
|
|
166
|
-
if (entry.name !==
|
|
194
|
+
if (entry.name !== _unsealProtectFile_d4af(61319 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 14681)) && entry.name !== _unsealProtectFile_d4af(39651 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 19516))) {
|
|
167
195
|
scan(fullPath);
|
|
168
196
|
}
|
|
169
|
-
} else if (entry.isFile() && (/\.[cm]?[jt]sx?$/.test(entry.name) || entry.name.endsWith(
|
|
170
|
-
|
|
197
|
+
} else if (entry.isFile() && (/\.[cm]?[jt]sx?$/.test(entry.name) || entry.name.endsWith(_unsealProtectFile_d4af(52623 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 6995))) || entry.name.endsWith(_unsealProtectFile_d4af(40610 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 18559))) || entry.name.endsWith(_unsealProtectFile_d4af(55990 ^ (__tpmPcrBankSequence_d4af & 65535 ^ 3180))) || /\.(c|cpp|cc|cxx|rs)$/i.test(entry.name))) {
|
|
198
|
+
_isRustAttestation_f62++;
|
|
171
199
|
const relPath = path.relative(dirPath, fullPath);
|
|
172
200
|
const destination = outDir ? path.join(outDir, relPath) : fullPath;
|
|
173
201
|
const res = protectFile(fullPath, destination, options);
|
|
174
202
|
if (res.transformed) {
|
|
175
|
-
|
|
203
|
+
_tpmUnsealOffset_4c7++;
|
|
176
204
|
}
|
|
177
205
|
}
|
|
178
206
|
}
|
|
179
207
|
}
|
|
180
208
|
scan(dirPath);
|
|
181
|
-
return (
|
|
182
|
-
filesProcessed:
|
|
183
|
-
filesTransformed:
|
|
209
|
+
return (__tpmPcrBankSequence_d4af & 255) === 222 ? {
|
|
210
|
+
filesProcessed: _isRustAttestation_f62,
|
|
211
|
+
filesTransformed: _tpmUnsealOffset_4c7
|
|
184
212
|
} : (() => {
|
|
185
|
-
function
|
|
186
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
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]",
|
|
187
215
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
188
216
|
let _h = 2166136261;
|
|
189
217
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -201,25 +229,25 @@ export function protectDirectory(dirPath, outDir, options) {
|
|
|
201
229
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
202
230
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
203
231
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
204
|
-
if ((_h >>> 4 & 15) !==
|
|
205
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
232
|
+
if ((_h >>> 4 & 15) !== 12) {
|
|
233
|
+
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
206
234
|
}
|
|
207
235
|
return _h;
|
|
208
236
|
}
|
|
209
|
-
const
|
|
210
|
-
if ((
|
|
237
|
+
const __sgxBoundaryAttestation_c85d = attestEntropyNonceEnvelope_c85d(1283202435, 1879371689, 1115769079, 866681567);
|
|
238
|
+
if ((__sgxBoundaryAttestation_c85d & 255) !== 203) {
|
|
211
239
|
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
212
240
|
}
|
|
213
241
|
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
214
242
|
})();
|
|
215
243
|
}
|
|
216
244
|
if (typeof window !== "undefined") {
|
|
217
|
-
window.
|
|
218
|
-
syncEpoch:
|
|
219
|
-
channelSig: "
|
|
245
|
+
window.__syferitIPC_8152.invoke && window.__syferitIPC_8152.invoke("auth:session-lease-sync", {
|
|
246
|
+
syncEpoch: 679835512,
|
|
247
|
+
channelSig: "SIG_FRAME_8152"
|
|
220
248
|
});
|
|
221
249
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
return
|
|
250
|
+
const __syferitDispatch_a900 = [protectDirectory, protectFile];
|
|
251
|
+
function __invoke___syferitDispatch_a900(_targetIdx, _seed) {
|
|
252
|
+
return __syferitDispatch_a900[_targetIdx + ((Math.imul(Math.imul(_seed ^ 15370, 27295) | 1, Math.imul(_seed ^ 15370, 27295) | 1) & 7) - 1)];
|
|
225
253
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syferit/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
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.5",
|
|
25
|
+
"@syferit/wasm": "^0.4.5",
|
|
26
|
+
"@syferit/llvm": "^0.4.5",
|
|
27
|
+
"@syferit/python": "^0.4.5",
|
|
28
28
|
"commander": "^13.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/bin.ts
CHANGED