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.

102 lines (80 loc) • 3.03 kB
#!/usr/bin/env node /** * Quick Fix Script - Copy Stencyption Fixed Version * * This script copies the fixed stencyption files to your project * so you can encrypt files without the .hex and import errors. * * Usage: * node QUICK_FIX_SCRIPT.js /path/to/your/bot/project */ const fs = require('fs'); const path = require('path'); const targetDir = process.argv[2]; if (!targetDir) { console.log('āŒ Error: Please provide target directory'); console.log('Usage: node QUICK_FIX_SCRIPT.js /path/to/your/bot/project'); process.exit(1); } const fixedDir = path.join(targetDir, 'stencyption-fixed'); console.log('šŸ“¦ Copying fixed stencyption to:', fixedDir); // Create directory if (!fs.existsSync(fixedDir)) { fs.mkdirSync(fixedDir, { recursive: true }); } // Copy files const filesToCopy = [ 'src/encryptor.js', 'src/runtime.js', 'src/index.js', 'src/cli.js' ]; for (const file of filesToCopy) { const source = path.join(__dirname, file); const dest = path.join(fixedDir, path.basename(file)); if (fs.existsSync(source)) { fs.copyFileSync(source, dest); console.log('āœ… Copied:', path.basename(file)); } else { console.log('āš ļø Not found:', file); } } // Create helper file const helperContent = `// Auto-generated helper for fixed stencyption const { Encryptor } = require('./stencyption-fixed/encryptor.js'); const { StencryptionRuntime } = require('./stencyption-fixed/runtime.js'); if (typeof global !== 'undefined') { global.__stencyption__ = StencryptionRuntime; } module.exports = { Encryptor, StencryptionRuntime }; `; fs.writeFileSync(path.join(targetDir, 'stencyption-helper.js'), helperContent); console.log('āœ… Created: stencyption-helper.js'); // Create example encryption script const exampleContent = `// Example: How to encrypt your files const fs = require('fs'); const { Encryptor } = require('./stencyption-helper.js'); // Change this to your file path const inputFile = './bot/login/login.js'; const outputFile = './bot/login/login.encrypted.js'; console.log('šŸ”’ Encrypting:', inputFile); const sourceCode = fs.readFileSync(inputFile, 'utf8'); const encrypted = Encryptor.encrypt(sourceCode); fs.writeFileSync(outputFile, encrypted, 'utf8'); console.log('āœ… Encrypted successfully!'); console.log('šŸ“ Output:', outputFile); console.log(''); console.log('To use the encrypted file:'); console.log('1. require(\\'./stencyption-helper.js\\');'); console.log('2. require(\\'./bot/login/login.encrypted.js\\');'); `; fs.writeFileSync(path.join(targetDir, 'encrypt-example.js'), exampleContent); console.log('āœ… Created: encrypt-example.js'); console.log('\nšŸŽ‰ Setup complete!'); console.log('\nNext steps:'); console.log('1. cd', targetDir); console.log('2. Edit encrypt-example.js to set your file paths'); console.log('3. node encrypt-example.js'); console.log('4. Use encrypted file in your code with:'); console.log(' require(\\'./stencyption-helper.js\\');'); console.log(' require(\\'./your-encrypted-file.js\\');');