@painsel/no-ai-wasm-engine 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.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @painsel/no-ai-wasm-engine
2
+
3
+ This is the core WebAssembly Decryption Engine used by the `@painsel/add-no-ai-badge` ecosystem.
4
+
5
+ ## Why WebAssembly?
6
+
7
+ AI scrapers, LLMs, and headless bots have gotten very good at statically analyzing and executing JavaScript. By moving our string decryption logic into a compiled WebAssembly (`.wasm`) binary, we make it nearly impossible for scrapers to reverse-engineer the decryption algorithm.
8
+
9
+ To a bot, this engine is just an opaque blob of unreadable binary instructions.
10
+
11
+ ## Proof of Human Entropy
12
+
13
+ The engine features a built-in honeypot: it requires an `entropy` score to execute correctly.
14
+ The main badge script tracks user mouse movement (Proof-of-Human work). If an automated bot or headless scraper runs the decryption function without naturally moving the mouse across the screen (resulting in an entropy score < 100), the WASM engine **intentionally corrupts its own internal key**.
15
+
16
+ The scraper believes it successfully decoded the text, but the output it scrapes is complete, unreadable gibberish.
17
+
18
+ ## Build from Source
19
+ ```bash
20
+ npm run asbuild
21
+ ```
22
+ This will compile the `assembly/index.ts` into a `build/release.wasm` binary.
@@ -0,0 +1,21 @@
1
+ // The entry file of your WebAssembly module.
2
+
3
+ /**
4
+ * Decrypts memory using XOR logic based on Proof-of-Work entropy.
5
+ * If entropy is less than 100, the key is intentionally corrupted to defeat scrapers.
6
+ *
7
+ * @param len The length of the string to decrypt in memory.
8
+ * @param key The base XOR key.
9
+ * @param entropy The tracked mouse distance score.
10
+ */
11
+ export function decrypt(len: i32, key: i32, entropy: i32): void {
12
+ // Headless bot check: If no mouse movement, corrupt the decryption key
13
+ if (entropy < 100) {
14
+ key = key ^ 0xFF; // Flip bits to produce garbage output
15
+ }
16
+
17
+ for (let i = 0; i < len; i++) {
18
+ let byte = load<u8>(i);
19
+ store<u8>(i, byte ^ key);
20
+ }
21
+ }
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@painsel/no-ai-wasm-engine",
3
+ "version": "1.0.0",
4
+ "description": "The WebAssembly Decryption Engine used for Anti-AI scraping protection",
5
+ "main": "index.js",
6
+ "files": [
7
+ "assembly/",
8
+ "build/",
9
+ "README.md"
10
+ ],
11
+ "scripts": {
12
+ "asbuild:untouched": "asc assembly/index.ts --target debug",
13
+ "asbuild:optimized": "asc assembly/index.ts --target release",
14
+ "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
15
+ "test": "echo \"Error: no test specified\" && exit 1"
16
+ },
17
+ "keywords": [
18
+ "wasm",
19
+ "anti-ai",
20
+ "scraper",
21
+ "bot",
22
+ "protection",
23
+ "assemblyscript"
24
+ ],
25
+ "type": "commonjs",
26
+ "devDependencies": {
27
+ "assemblyscript": "^0.28.20"
28
+ }
29
+ }