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.

46 lines (38 loc) 2.01 kB
const fs = require('fs'); const { Encryptor, StencryptionRuntime } = require('./src/index.js'); console.log('\n╔═══════════════════════════════════════════════════════════╗'); console.log('║ STENCYPTION - Demo & Test Suite ║'); console.log('║ Global Context Preservation + Encryption Support ║'); console.log('╚═══════════════════════════════════════════════════════════╝\n'); if (typeof global !== 'undefined') { global.__stencyption__ = StencryptionRuntime; } console.log('🔬 Testing Global Variable Preservation...\n'); const path = require('path'); const encryptedFilePath = path.join(__dirname, 'test-global.encrypted.js'); if (fs.existsSync(encryptedFilePath)) { console.log('✓ Found encrypted test file with global variable dependencies\n'); console.log('─'.repeat(60)); try { require(encryptedFilePath); console.log('─'.repeat(60)); console.log('\n✅ SUCCESS! Global variables are preserved in encrypted files'); console.log(' This fix allows large files like login.js and utils.js'); console.log(' to work correctly when encrypted.\n'); } catch (error) { console.error('❌ Error:', error.message); console.error('Stack:', error.stack); process.exit(1); } } else { console.log('⚠️ Encrypted test file not found'); console.log(' Run: stencyption encrypt test-global.js\n'); } console.log('📚 Usage:'); console.log(' stencyption encrypt <file.js>'); console.log(' stencyption encrypt <file.js> -o <output.js>'); console.log('\n✨ Features:'); console.log(' ✓ Global context preservation (NEW FIX)'); console.log(' ✓ Relative imports support'); console.log(' ✓ npm packages support'); console.log(' ✓ AES-256 encryption\n');