@abelionorg/tagger-public 1.0.0

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.
@@ -0,0 +1 @@
1
+ export declare function keygenAction(): void;
@@ -0,0 +1 @@
1
+ export declare function tagAction(targetPath: string, options: any): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function verifyAction(file: string): void;
@@ -0,0 +1,21 @@
1
+ export interface KeyPair {
2
+ publicKey: string;
3
+ privateKey: string;
4
+ }
5
+ /**
6
+ * Generates a new RSA key pair for abelion512.
7
+ */
8
+ export declare function generateKeyPair(): KeyPair;
9
+ /**
10
+ * Signs a payload using the private key.
11
+ */
12
+ export declare function signPayload(payload: string, privateKey: string): string;
13
+ /**
14
+ * Verifies a signature using the public key.
15
+ */
16
+ export declare function verifyPayload(payload: string, signature: string, publicKey: string): boolean;
17
+ /**
18
+ * Hashes a password using SHA-256 with a salt.
19
+ * Used for secure untag verification.
20
+ */
21
+ export declare function hashPassword(password: string, salt: string): string;
@@ -0,0 +1 @@
1
+ export declare function injectCPP(content: string, watermark: string): string;
@@ -0,0 +1 @@
1
+ export declare function injectCSS(content: string, watermark: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * HTML Driver - Public Version
3
+ * Focused on attribution and transparency.
4
+ * v2.3: Fixed duplicate stealthTag and improved attribution.
5
+ */
6
+ export declare function injectHTML(content: string, watermark: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * JS/TS Driver - Public Version
3
+ * Focused on attribution and transparency.
4
+ * No anti-debug or covert tracking.
5
+ */
6
+ export declare function injectJS(content: string, watermark: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PHP Driver - Public Version
3
+ * Focused on attribution and transparency.
4
+ * No auto-ping or tracking features.
5
+ */
6
+ export declare function injectPHP(content: string, watermark: string): string;
@@ -0,0 +1 @@
1
+ export declare function injectPython(content: string, watermark: string): string;
@@ -0,0 +1,8 @@
1
+ export * from './crypto';
2
+ export * from './stealth';
3
+ export * from './drivers/javascript';
4
+ export * from './drivers/python';
5
+ export * from './drivers/html';
6
+ export * from './drivers/css';
7
+ export * from './drivers/php';
8
+ export * from './drivers/cpp';
package/dist/index.js ADDED
@@ -0,0 +1,260 @@
1
+ import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
34
+
35
+ // src/crypto.ts
36
+ import * as crypto from "crypto";
37
+ function generateKeyPair() {
38
+ const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", {
39
+ modulusLength: 2048,
40
+ publicKeyEncoding: {
41
+ type: "spki",
42
+ format: "pem"
43
+ },
44
+ privateKeyEncoding: {
45
+ type: "pkcs8",
46
+ format: "pem"
47
+ }
48
+ });
49
+ return { publicKey, privateKey };
50
+ }
51
+ function signPayload(payload, privateKey) {
52
+ const sign = crypto.createSign("SHA256");
53
+ sign.update(payload);
54
+ sign.end();
55
+ return sign.sign(privateKey, "hex");
56
+ }
57
+ function verifyPayload(payload, signature, publicKey) {
58
+ const verify = crypto.createVerify("SHA256");
59
+ verify.update(payload);
60
+ verify.end();
61
+ return verify.verify(publicKey, signature, "hex");
62
+ }
63
+ function hashPassword(password, salt) {
64
+ return crypto.createHmac("sha256", salt).update(password).digest("hex");
65
+ }
66
+ // src/stealth.ts
67
+ var ZW0 = "​";
68
+ var ZW1 = "‌";
69
+ var ZW2 = "‍";
70
+ var ZW3 = "\uFEFF";
71
+ var SEP = "‎";
72
+ var ENCODE_LOOKUP = new Array(256);
73
+ var DIGITS = [ZW0, ZW1, ZW2, ZW3];
74
+ for (let i = 0;i < 256; i++) {
75
+ let res = "";
76
+ if (i === 0) {
77
+ res = ZW0;
78
+ } else {
79
+ let c = i;
80
+ while (c > 0) {
81
+ res = DIGITS[c & 3] + res;
82
+ c >>= 2;
83
+ }
84
+ }
85
+ ENCODE_LOOKUP[i] = res;
86
+ }
87
+ var DECODE_LOOKUP = {
88
+ [ZW0]: 0,
89
+ [ZW1]: 1,
90
+ [ZW2]: 2,
91
+ [ZW3]: 3
92
+ };
93
+ function encodeStealth(data, version = "v2.3") {
94
+ const salt = Math.random().toString(36).slice(2, 8);
95
+ const payload = version + "|" + salt + "|" + data;
96
+ let result = "";
97
+ for (let i = 0;i < payload.length; i++) {
98
+ const code = payload.charCodeAt(i);
99
+ if (code < 256) {
100
+ result += ENCODE_LOOKUP[code];
101
+ } else {
102
+ let temp = "";
103
+ let c = code;
104
+ while (c > 0) {
105
+ temp = DIGITS[c & 3] + temp;
106
+ c >>= 2;
107
+ }
108
+ result += temp;
109
+ }
110
+ if (i < payload.length - 1) {
111
+ result += SEP;
112
+ }
113
+ }
114
+ return result;
115
+ }
116
+ function decodeStealth(stealth) {
117
+ let result = "";
118
+ let currentCode = 0;
119
+ let hasData = false;
120
+ for (let i = 0;i < stealth.length; i++) {
121
+ const char = stealth[i];
122
+ if (char === SEP) {
123
+ if (hasData) {
124
+ result += String.fromCharCode(currentCode);
125
+ currentCode = 0;
126
+ hasData = false;
127
+ }
128
+ continue;
129
+ }
130
+ const digit = DECODE_LOOKUP[char];
131
+ if (digit !== undefined) {
132
+ currentCode = currentCode << 2 | digit;
133
+ hasData = true;
134
+ }
135
+ }
136
+ if (hasData) {
137
+ result += String.fromCharCode(currentCode);
138
+ }
139
+ const parts = result.split("|");
140
+ return parts.length === 3 ? parts[2] : result;
141
+ }
142
+ function encryptString(str) {
143
+ const key = Math.floor(Math.random() * 255);
144
+ const encrypted = [];
145
+ for (let i = 0;i < str.length; i++) {
146
+ encrypted.push(str.charCodeAt(i) ^ key);
147
+ }
148
+ const decFuncs = [
149
+ `(function(a,k){return a.map(function(c){return String.fromCharCode(c^k)}).join('')})`,
150
+ `(function(x,y){var s='';for(var i=0;i<x.length;i++){s+=String.fromCharCode(x[i]^y)}return s})`
151
+ ];
152
+ const chosen = decFuncs[Math.floor(Math.random() * decFuncs.length)];
153
+ return `(${chosen}([${encrypted.join(",")}],${key}))`;
154
+ }
155
+ function getOpaquePredicateJS() {
156
+ const a = Math.floor(Math.random() * 50) + 1;
157
+ const b = Math.floor(Math.random() * 50) + 1;
158
+ const variants = [
159
+ `((Math.pow(${a}, 2) - Math.pow(${b}, 2)) === ((${a} - ${b}) * (${a} + ${b})))`,
160
+ `(((${a} << 1) ^ (${a} >> 1)) !== ((${b} << 1) ^ (${b} >> 1)) || ${a} === ${a})`,
161
+ `(function(n){var f=function(x){return x<2?1:f(x-1)+f(x-2)};return f(5) === 8})(${a})`
162
+ ];
163
+ return variants[Math.floor(Math.random() * variants.length)];
164
+ }
165
+ // src/drivers/javascript.ts
166
+ function injectJS(content, watermark) {
167
+ const stealthTag = encodeStealth(watermark);
168
+ const predicate = getOpaquePredicateJS();
169
+ const guardName = "v" + Math.random().toString(36).slice(2, 7);
170
+ const guard = `
171
+ /**
172
+ * Protected by Abelion (Public)
173
+ * Identity: ${watermark}
174
+ */
175
+ (function(${guardName}){
176
+ // Integrity check
177
+ if(!${predicate}) {
178
+ console.warn("Abelion: Code integrity check failed.");
179
+ return;
180
+ }
181
+
182
+ ${content}
183
+ })(function ${guardName}(){/*${stealthTag}*/});`;
184
+ return guard;
185
+ }
186
+ // src/drivers/python.ts
187
+ function injectPython(content, watermark) {
188
+ const stealthTag = encodeStealth(watermark);
189
+ const brand = "A" + "b" + "e" + "l" + "i" + "o" + "n";
190
+ const guard = `
191
+ # @license: ${brand} (Public) (c) 2026${stealthTag}
192
+ # Identity: ${watermark}
193
+ `;
194
+ return guard + `
195
+ ` + content;
196
+ }
197
+ // src/drivers/html.ts
198
+ function injectHTML(content, watermark) {
199
+ const stealthTag = encodeStealth(watermark);
200
+ const guard = `<!-- Abelion Identity (Public): ${watermark}${stealthTag} -->
201
+ <meta name="generator" content="Abelion Framework v2.3-${watermark.slice(0, 8)}">`;
202
+ if (content.includes("<head>")) {
203
+ return content.replace("<head>", `<head>
204
+ ` + guard);
205
+ }
206
+ return guard + `
207
+ ` + content;
208
+ }
209
+ // src/drivers/css.ts
210
+ function injectCSS(content, watermark) {
211
+ const stealthTag = encodeStealth(watermark);
212
+ const guard = `/* @license Abelion Integrity Guard v1.2 (c) 2026${stealthTag} */
213
+ :root { --abelion-integrity: "${watermark.substring(0, 16)}"; }`;
214
+ return guard + `
215
+ ` + content;
216
+ }
217
+ // src/drivers/php.ts
218
+ function injectPHP(content, watermark) {
219
+ const stealthTag = encodeStealth(watermark);
220
+ const guard = `<?php
221
+ /**
222
+ * @license Abelion Integrity Guard v1.3 (c) 2026${stealthTag}
223
+ * Owner: ${watermark}
224
+ */
225
+ `;
226
+ if (content.trim().startsWith("<?php")) {
227
+ return content.replace("<?php", guard);
228
+ }
229
+ return guard + `
230
+ ` + content;
231
+ }
232
+ // src/drivers/cpp.ts
233
+ function injectCPP(content, watermark) {
234
+ const stealthTag = encodeStealth(watermark);
235
+ const guard = `
236
+ /* @license Abelion Integrity Guard v1.2 (c) 2026${stealthTag} */
237
+ #ifndef ABELION_GUARD
238
+ #define ABELION_GUARD "${watermark}"
239
+ // Note: In C++, stealth is harder, but we embed it in a macro
240
+ #endif
241
+ `;
242
+ return guard + `
243
+ ` + content;
244
+ }
245
+ export {
246
+ verifyPayload,
247
+ signPayload,
248
+ injectPython,
249
+ injectPHP,
250
+ injectJS,
251
+ injectHTML,
252
+ injectCSS,
253
+ injectCPP,
254
+ hashPassword,
255
+ getOpaquePredicateJS,
256
+ generateKeyPair,
257
+ encryptString,
258
+ encodeStealth,
259
+ decodeStealth
260
+ };
@@ -0,0 +1 @@
1
+ export declare function logSecurityAnomaly(message: string, context?: any): void;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Advanced Polymorphic Stealth Encoding (v2.4 - Bolt Optimized)
3
+ * Optimized for high-performance zero-width processing using pre-calculated lookup tables.
4
+ */
5
+ /**
6
+ * Encodes data with high efficiency.
7
+ * Uses pre-calculated lookup table for rapid character conversion.
8
+ */
9
+ export declare function encodeStealth(data: string, version?: string): string;
10
+ /**
11
+ * Decodes stealth data using manual loop and fast lookup.
12
+ */
13
+ export declare function decodeStealth(stealth: string): string;
14
+ /**
15
+ * High-level string encryption for runtime evasion.
16
+ */
17
+ export declare function encryptString(str: string): string;
18
+ /**
19
+ * Complex Opaque Predicates to confuse AI logic pathing.
20
+ */
21
+ export declare function getOpaquePredicateJS(): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const SUPPORTED_EXTENSIONS: Set<string>;
2
+ export declare const EXCLUDED_PATTERNS: string[];
3
+ export declare function isValidWatermarkMessage(message: string): boolean;
4
+ export declare function getAllFiles(dir: string, fileList?: string[]): string[];
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@abelionorg/tagger-public",
3
+ "version": "1.0.0",
4
+ "description": "Stealth tagging and anti-theft system for Abelion ecosystem",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org",
7
+ "access": "public"
8
+ },
9
+ "main": "dist/index.js",
10
+ "module": "dist/index.mjs",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "require": "./dist/index.js",
16
+ "import": "./dist/index.mjs"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "TUTORIAL.md",
22
+ "README.md"
23
+ ],
24
+ "bin": {
25
+ "abelion-tagger": "./dist/cli.js"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/Abelion512/abelion-tagger.git",
30
+ "directory": "packages/tagger-public"
31
+ },
32
+ "scripts": {
33
+ "build": "bun build src/index.ts src/cli.ts --outdir dist --target node && npx tsc -p tsconfig.json --emitDeclarationOnly --outDir dist",
34
+ "dev": "bun build src/index.ts src/cli.ts --outdir dist --target node --watch",
35
+ "benchmark": "bun run src/benchmark.ts",
36
+ "test": "bun test",
37
+ "typecheck": "npx tsc -p tsconfig.json --noEmit",
38
+ "prepublishOnly": "npm run build && npm run typecheck"
39
+ },
40
+ "keywords": [
41
+ "watermark",
42
+ "steganography",
43
+ "security",
44
+ "cli",
45
+ "bun"
46
+ ],
47
+ "engines": {
48
+ "node": ">=18",
49
+ "bun": ">=1.0.0"
50
+ },
51
+ "author": "abelion",
52
+ "license": "MIT",
53
+ "devDependencies": {
54
+ "@types/node": "^20.0.0",
55
+ "bun-types": "^1.3.11",
56
+ "typescript": "^5.0.0"
57
+ },
58
+ "dependencies": {
59
+ "chalk": "^4.1.2",
60
+ "commander": "^12.0.0",
61
+ "crypto-js": "^4.2.0"
62
+ }
63
+ }