UNPKG

stencyption

Version:

Military-grade JavaScript encryption with AES-256-GCM, polymorphic obfuscation, and anti-debugging protection. Each file gets unique encryption keys embedded in heavily obfuscated code.

143 lines (94 loc) 2.74 kB
# How to Use Stencyption Package ## Step 1: Setup Link the package globally: ```bash npm link ``` This makes the `stencyption` command available everywhere. ## Step 2: Encrypt Files ### Method 1: Using CLI Command ```bash stencyption encrypt yourfile.js ``` This creates `yourfile.encrypted.js` ### Method 2: Using encrypt.js Script ```bash node encrypt.js yourfile.js ``` Or with custom output: ```bash node encrypt.js yourfile.js outputfile.encrypted.js ``` ## Step 3: Run Encrypted Files Just run them like normal JavaScript: ```bash node yourfile.encrypted.js ``` ## Real Examples ### Encrypt a login file ```bash stencyption encrypt bot/login/login.js -o bot/login/login.encrypted.js ``` ### Encrypt with relative imports If your file has imports like: ```javascript const log = require("./logger/log.js"); const utils = require("./utils/helpers.js"); ``` Just encrypt it normally: ```bash stencyption encrypt myfile.js ``` The encrypted version will work perfectly - all imports are preserved! ### Encrypt files with npm packages If your file uses npm packages: ```javascript const axios = require("axios"); const crypto = require("crypto"); const cheerio = require("cheerio"); ``` Just encrypt normally: ```bash stencyption encrypt mycode.js ``` Everything works - no undefined errors! ## Common Issues ### "Cannot find module 'stencyption'" **Solution**: Make sure you linked the package: ```bash npm link ``` ### "Cannot read properties of undefined (reading 'hex')" **Solution**: You're using the old npm version. Use this fixed version by running `npm link` in this directory. ### Relative imports not working **Solution**: This version is fixed! Relative imports work perfectly now. ## Package Name Usage After linking with `npm link`, you can use the package by name: ```bash # Use the stencyption command stencyption encrypt file.js # Or use programmatically node -e "const {Encryptor} = require('stencyption'); console.log('Loaded!');" ``` ## Programmatic Encryption Create your own encryption script: ```javascript const fs = require('fs'); const { Encryptor } = require('stencyption'); const code = fs.readFileSync('./myfile.js', 'utf8'); const encrypted = Encryptor.encrypt(code); fs.writeFileSync('./myfile.encrypted.js', encrypted, 'utf8'); console.log('✅ Done!'); ``` ## What Works ✅ Relative imports: `require("./local/file.js")` ✅ npm packages: `require("axios")` ✅ Built-in modules: `require("crypto")` ✅ Complex code with .hex, .toString(), etc. ✅ Multi-file projects ✅ All JavaScript features ## Version Info **Current Version**: 1.0.5 **Fixed Issues**: Relative imports, undefined properties, path resolution --- For more details, see README.md