stickcode 3.1.5 → 3.1.6

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 CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # StickCode Engine v3.1.4 🚀
2
+ # StickCode Engine v3.1.6 🚀
3
3
 
4
4
 
5
5
 
@@ -23,23 +23,33 @@ npm install stickcode
23
23
 
24
24
  ```javascript
25
25
  const StickCode = require('stickcode');
26
- function run() {
27
- try {
28
26
 
29
- // 1. Initialize with your unique encrypted license payload
30
- StickCode.init(process.env.STICKCODE_LICENSE);
27
+ async function run() {
28
+ try {
29
+ // 1. Initialize with your unique encrypted license payload
30
+ await StickCode.init(process.env.STICKCODE_LICENSE);
31
31
 
32
- // 2. Encrypt & Compress (Returns a raw binary Buffer)
33
- const data = "Sensitive Corporate Intellectual Property";
34
- const secureBuffer = StickCode.encrypt(data);
32
+ // --- Option A: Standard High-Security Mode ---
33
+ // Automatically uses the latest encryption and compression logic
34
+ const sensitiveData = "Sensitive Corporate Intellectual Property";
35
+ const encryptedBuffer = StickCode.encrypt(sensitiveData);
35
36
 
36
- // 3. Decrypt & Decompress
37
- const original = StickCode.decrypt(secureBuffer);
38
- console.log("Status: Data Integrity Verified");
39
- console.log("Output:", original);
40
- } catch (err) {
41
- console.error("Security Alert:", err.message);
42
- }
37
+ // --- Option B: Compression-Only Mode (Optimized for short strings) ---
38
+ // Passing 'true' bypasses encryption to save weight on small payloads
39
+ const shortData = "Log: System OK";
40
+ const compressedBuffer = StickCode.encrypt(shortData, true);
41
+
42
+ // 3. Transparent Decryption
43
+ // The engine automatically detects the mode and applies the correct logic
44
+ const originalA = StickCode.decrypt(encryptedBuffer);
45
+ const originalB = StickCode.decrypt(compressedBuffer);
46
+
47
+ console.log("Output A:", originalA);
48
+ console.log("Output B:", originalB);
49
+
50
+ } catch (err) {
51
+ console.error("Security Alert:", err.message);
52
+ }
43
53
  }
44
54
  run();
45
55
  ```
package/engine/index.js CHANGED
@@ -1 +1 @@
1
- const a0_0x321c4a=a0_0x48a9;(function(_0x451cde,_0x353c1d){const _0x3d5b06=a0_0x48a9,_0x58e135=_0x451cde();while(!![]){try{const _0x1be662=parseInt(_0x3d5b06(0xb3))/0x1*(-parseInt(_0x3d5b06(0xde))/0x2)+parseInt(_0x3d5b06(0xd3))/0x3+parseInt(_0x3d5b06(0xa1))/0x4+-parseInt(_0x3d5b06(0xd8))/0x5+-parseInt(_0x3d5b06(0xbd))/0x6+-parseInt(_0x3d5b06(0x98))/0x7*(-parseInt(_0x3d5b06(0x97))/0x8)+parseInt(_0x3d5b06(0xc5))/0x9*(parseInt(_0x3d5b06(0x9e))/0xa);if(_0x1be662===_0x353c1d)break;else _0x58e135['push'](_0x58e135['shift']());}catch(_0x2e5857){_0x58e135['push'](_0x58e135['shift']());}}}(a0_0x145e,0xbcc3e));const crypto=require(a0_0x321c4a(0xcb)),zlib=require('zlib'),fs=require('fs'),os=require('os'),path=require(a0_0x321c4a(0x8e));function __checkIntegrity(){const _0x177b53=a0_0x321c4a,_0x56d97d=(function(){let _0x1c581c=!![];return function(_0x1e16b0,_0x2b99bc){const _0x59f421=_0x1c581c?function(){const _0x57eb25=a0_0x48a9;if(_0x2b99bc){const _0x55c41d=_0x2b99bc[_0x57eb25(0xcc)](_0x1e16b0,arguments);return _0x2b99bc=null,_0x55c41d;}}:function(){};return _0x1c581c=![],_0x59f421;};}()),_0x1415f6=_0x56d97d(this,function(){const _0x12e3b3=a0_0x48a9;return _0x1415f6[_0x12e3b3(0xcd)]()[_0x12e3b3(0xc9)](_0x12e3b3(0xc6))['toString']()[_0x12e3b3(0xdf)](_0x1415f6)[_0x12e3b3(0xc9)](_0x12e3b3(0xc6));});_0x1415f6();const _0x2316ff=(function(){let _0x207e3c=!![];return function(_0xda59e7,_0x145d0c){const _0x4d8289=_0x207e3c?function(){const _0xb34200=a0_0x48a9;if(_0x145d0c){const _0x88c40d=_0x145d0c[_0xb34200(0xcc)](_0xda59e7,arguments);return _0x145d0c=null,_0x88c40d;}}:function(){};return _0x207e3c=![],_0x4d8289;};}());(function(){_0x2316ff(this,function(){const _0x2cfb7e=a0_0x48a9,_0x35cedc=new RegExp(_0x2cfb7e(0x90)),_0x217f43=new RegExp(_0x2cfb7e(0xb4),'i'),_0x315e02=_0x3a4dfc(_0x2cfb7e(0xb0));!_0x35cedc['test'](_0x315e02+_0x2cfb7e(0xae))||!_0x217f43[_0x2cfb7e(0x99)](_0x315e02+'input')?_0x315e02('0'):_0x3a4dfc();})();}());try{const _0x4f6feb=fs[_0x177b53(0xb1)](__filename,_0x177b53(0xbf))['trim']();if(!/\/\/[a-f0-9]{64}$/[_0x177b53(0x99)](_0x4f6feb))return;const _0x18c9cb=_0x4f6feb[_0x177b53(0xd5)](0x0,-0x42)[_0x177b53(0xc8)](),_0x49f237=_0x4f6feb['slice'](-0x40),_0x22d835=crypto[_0x177b53(0xcf)](_0x177b53(0x95))['update'](_0x18c9cb)[_0x177b53(0xdb)]('hex');_0x22d835!==_0x49f237&&process[_0x177b53(0xd0)](0x1);}catch(_0x3574de){process[_0x177b53(0xd0)](0x1);}}__checkIntegrity();const PUBLIC_KEY=a0_0x321c4a(0xe2),REG_FILE=path[a0_0x321c4a(0xbb)](os[a0_0x321c4a(0xa0)](),a0_0x321c4a(0xaa)),ALGO='aes-256-gcm';function a0_0x145e(){const _0x340bb0=['BROTLI_PARAM_QUALITY','join','existsSync','5631330GNAQpt','constants','utf8','final','from','Invalid\x20license\x20format:\x20missing\x20payload\x20or\x20signature','\x0a[StickCode\x20Warning]\x20Device\x20limit\x20reached.','update','3288087TPPnAe','(((.+)+)+)+$','arch','trim','search','includes','crypto','apply','toString','devices','createHash','exit','brotliDecompressSync','parse','3715458fenTNq','Payload\x20too\x20short\x20for\x20V3\x20structure','slice','Invalid\x20license\x20signature','base64','4075720nfHedZ','push','gger','digest','features','call','2OOCruX','constructor','key','getAuthTag','-----BEGIN\x20PUBLIC\x20KEY-----\x0aMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bkpTd0NHw8SMK0HGAEj\x0ayJW9fK0/mBXTuyCDL4lkNMReu3tTGECZ5xuS96T5xKRk8ylHzVs+hlSEb4rjpDIS\x0avoYLC+fG3aB8YAz8NZ4jT3FXxa+gKo5IIwlEunt5ppi8PyQetUjtuqboxtKhlj8q\x0aME7D/Ro6BoSVvAdczDQj7JIdj390V3vT8K3/aPXJFl/j+AWwSMGAYLT1tlDwZR2V\x0aiaAfmbKa5PSFZ5Mg77YQ6jbKOplymmwUmFcpIzrY7U6DjRRwPwoBh+4wlDQ8Urid\x0a4kZB8IagfHj/ChRPgY/bBsBw+37krmhB0UUp4M1XezmyXvwKKF4ZK2XGDDrG0TkH\x0abQIDAQAB\x0a-----END\x20PUBLIC\x20KEY-----','randomBytes','path','Current\x20license\x20allows\x20a\x20maximum\x20of\x20','function\x20*\x5c(\x20*\x5c)','createCipheriv','createDecipheriv','verify','stringify','sha256','platform','24LTUjEH','1330077QamoOn','test','Unsupported\x20encryption\x20version:\x20','concat','warn','[StickCode\x20Info]\x20Active\x20nodes:\x20','10xnNrqb','Device\x20limit\x20reached','homedir','3626440TTcesI','Failed\x20to\x20restore\x20data\x20from\x20color\x20map.','length','string','stateObject','counter','_unmapFromColors','licenseId','createVerify','.stickcode_license','writeFileSync','hex','maxDevices','chain','\x20devices.','init','readFileSync','StickCode\x20Error:\x20Security\x20engine\x20not\x20initialized.\x20Please\x20call\x20.init(license)\x20first.','553591jQtUGL','\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','_mapToColors','debu','action','License\x20input\x20is\x20a\x20string\x20but\x20not\x20a\x20valid\x20JSON','while\x20(true)\x20{}'];a0_0x145e=function(){return _0x340bb0;};return a0_0x145e();}function getMachineId(){const _0x10ca84=a0_0x321c4a;return crypto[_0x10ca84(0xcf)](_0x10ca84(0x95))['update'](os['hostname']()+os[_0x10ca84(0x96)]()+os[_0x10ca84(0xc7)]())[_0x10ca84(0xdb)](_0x10ca84(0xac));}function verifyLicense(_0x5bcedc){const _0x43859e=a0_0x321c4a;let _0x5708a8;if(typeof _0x5bcedc==='string')try{_0x5708a8=JSON[_0x43859e(0xd2)](_0x5bcedc);}catch(_0x2595ff){throw new Error(_0x43859e(0xb8));}else _0x5708a8=_0x5bcedc;const {payload:_0x2b0c77,signature:_0x35e652}=_0x5708a8;if(!_0x2b0c77||!_0x35e652)throw new Error(_0x43859e(0xc2));const _0x54b442=crypto[_0x43859e(0xa9)]('SHA256');_0x54b442['update'](_0x2b0c77);if(!_0x54b442[_0x43859e(0x93)](PUBLIC_KEY,_0x35e652,'base64'))throw new Error(_0x43859e(0xd6));return JSON[_0x43859e(0xd2)](Buffer[_0x43859e(0xc1)](_0x2b0c77,_0x43859e(0xd7))[_0x43859e(0xcd)]());}function loadRegistry(){const _0x193d8a=a0_0x321c4a;if(!fs[_0x193d8a(0xbc)](REG_FILE))return{'devices':[]};try{return JSON[_0x193d8a(0xd2)](fs[_0x193d8a(0xb1)](REG_FILE));}catch(_0x2ed1ab){return{'devices':[]};}}function a0_0x48a9(_0x45e963,_0x3f5523){_0x45e963=_0x45e963-0x8e;const _0x327b50=a0_0x145e();let _0x3a4dfc=_0x327b50[_0x45e963];return _0x3a4dfc;}function saveRegistry(_0x1f0652){const _0x4cf788=a0_0x321c4a;fs[_0x4cf788(0xab)](REG_FILE,JSON[_0x4cf788(0x94)](_0x1f0652));}const StickCode={'VERSION':5.2,'key':null,'features':[],'init'(_0x311d4b){const _0x701d16=a0_0x321c4a,_0x15f76b=verifyLicense(_0x311d4b),_0x1b0c4f=getMachineId();let _0x23d165=loadRegistry();if(!_0x23d165[_0x701d16(0xce)][_0x701d16(0xca)](_0x1b0c4f)){if(_0x23d165[_0x701d16(0xce)][_0x701d16(0xa3)]>=_0x15f76b[_0x701d16(0xad)]){console[_0x701d16(0x9c)](_0x701d16(0xc3)),console[_0x701d16(0x9c)](_0x701d16(0x8f)+_0x15f76b[_0x701d16(0xad)]+_0x701d16(0xaf));throw new Error(_0x701d16(0x9f));}_0x23d165[_0x701d16(0xce)][_0x701d16(0xd9)](_0x1b0c4f),saveRegistry(_0x23d165);}(_0x23d165[_0x701d16(0xce)][_0x701d16(0xa3)]>=0xa||_0x23d165[_0x701d16(0xce)][_0x701d16(0xa3)]===_0x15f76b['maxDevices'])&&console['log'](_0x701d16(0x9d)+_0x23d165['devices'][_0x701d16(0xa3)]+'/'+_0x15f76b[_0x701d16(0xad)]),this['features']=_0x15f76b[_0x701d16(0xdc)]||[],this[_0x701d16(0xe0)]=crypto['createHash'](_0x701d16(0x95))[_0x701d16(0xc4)](_0x15f76b[_0x701d16(0xa8)]+'STATIC_SALT_882')['digest']();},'_ensureInitialized'(){const _0x473598=a0_0x321c4a;if(!this[_0x473598(0xe0)])throw new Error(_0x473598(0xb2));},'_mapToColors'(_0x28d9a0){const _0x1286e0=a0_0x321c4a,_0x3eb83a=zlib['brotliCompressSync'](_0x28d9a0,{'params':{[zlib[_0x1286e0(0xbe)][_0x1286e0(0xba)]]:0x6}}),_0x334a30=[];for(let _0x5a2d45=0x0;_0x5a2d45<_0x3eb83a[_0x1286e0(0xa3)];_0x5a2d45+=0x3){_0x334a30[_0x1286e0(0xd9)](_0x3eb83a[_0x5a2d45]||0x0),_0x334a30[_0x1286e0(0xd9)](_0x3eb83a[_0x5a2d45+0x1]||0x0),_0x334a30['push'](_0x3eb83a[_0x5a2d45+0x2]||0x0);}return Buffer[_0x1286e0(0xc1)](_0x334a30);},'_unmapFromColors'(_0x3ccc1e){const _0x5c6c34=a0_0x321c4a;for(let _0x4bf3a7=_0x3ccc1e[_0x5c6c34(0xa3)];_0x4bf3a7>0x0;_0x4bf3a7--){try{return zlib[_0x5c6c34(0xd1)](_0x3ccc1e[_0x5c6c34(0xd5)](0x0,_0x4bf3a7));}catch(_0x4d18a4){}}throw new Error(_0x5c6c34(0xa2));},'encrypt'(_0x4b6f97,_0x5423b2=0x2){const _0x24f034=a0_0x321c4a;this['_ensureInitialized']();const _0x3ef0de=this[_0x24f034(0xb5)](Buffer[_0x24f034(0xc1)](_0x4b6f97)),_0x4348f1=crypto['randomBytes'](0xc),_0x2730b7=crypto[_0x24f034(0x91)](ALGO,this[_0x24f034(0xe0)],_0x4348f1),_0x3dc5a8=Buffer[_0x24f034(0x9b)]([_0x2730b7[_0x24f034(0xc4)](_0x3ef0de),_0x2730b7[_0x24f034(0xc0)]()]),_0x1fb21a=_0x2730b7[_0x24f034(0xe1)](),_0x5e8aeb=crypto['randomBytes'](_0x5423b2*0x2),_0x4d157e=crypto[_0x24f034(0xe3)](0x5);if(_0x5423b2===0x2)return Buffer['concat']([Buffer[_0x24f034(0xc1)]([_0x5423b2]),_0x5e8aeb,_0x4348f1,_0x1fb21a,_0x3dc5a8]);else{if(_0x5423b2===0x3)return Buffer[_0x24f034(0x9b)]([Buffer['from']([_0x5423b2]),_0x4348f1,_0x4d157e,_0x3dc5a8,_0x1fb21a,_0x5e8aeb]);else{if(_0x5423b2===0x4){}}}throw new Error(_0x24f034(0x9a)+_0x5423b2);},'decrypt'(_0x5845c5){const _0x45ffa0=a0_0x321c4a;this['_ensureInitialized']();const _0x37197e=_0x5845c5[0x0];let _0x514f2f,_0x54bfd1,_0x26460b;switch(_0x37197e){case 0x2:{const _0x3ff5bf=_0x37197e*0x2,_0x1dfc78=0x1+_0x3ff5bf;_0x514f2f=_0x5845c5[_0x45ffa0(0xd5)](_0x1dfc78,_0x1dfc78+0xc),_0x54bfd1=_0x5845c5[_0x45ffa0(0xd5)](_0x1dfc78+0xc,_0x1dfc78+0x1c),_0x26460b=_0x5845c5[_0x45ffa0(0xd5)](_0x1dfc78+0x1c);break;}case 0x3:{const _0x392f85=_0x37197e*0x2,_0x16de77=0x1+0xc+0x5+0x10+_0x392f85;if(_0x5845c5[_0x45ffa0(0xa3)]<_0x16de77)throw new Error(_0x45ffa0(0xd4));_0x514f2f=_0x5845c5[_0x45ffa0(0xd5)](0x1,0xd),_0x54bfd1=_0x5845c5['slice'](_0x5845c5['length']-0x10-_0x392f85,_0x5845c5[_0x45ffa0(0xa3)]-_0x392f85),_0x26460b=_0x5845c5[_0x45ffa0(0xd5)](0x12,_0x5845c5[_0x45ffa0(0xa3)]-0x10-_0x392f85);break;}case 0x4:{}default:throw new Error('Unsupported\x20payload\x20version:\x200x'+_0x37197e[_0x45ffa0(0xcd)](0x10)['padStart'](0x2,'0'));}const _0x32c2fa=crypto[_0x45ffa0(0x92)](ALGO,this['key'],_0x514f2f);_0x32c2fa['setAuthTag'](_0x54bfd1);const _0x257f99=Buffer[_0x45ffa0(0x9b)]([_0x32c2fa[_0x45ffa0(0xc4)](_0x26460b),_0x32c2fa['final']()]);return _0x37197e===0x2||_0x37197e===0x3?this[_0x45ffa0(0xa7)](_0x257f99)[_0x45ffa0(0xcd)]():_0x257f99[_0x45ffa0(0xcd)]();},'resetDevices'(){saveRegistry({'devices':[]});}};module['exports']=StickCode;function _0x3a4dfc(_0x57a85c){function _0x1481d9(_0x231a4c){const _0x2ade4e=a0_0x48a9;if(typeof _0x231a4c===_0x2ade4e(0xa4))return function(_0x668a54){}[_0x2ade4e(0xdf)](_0x2ade4e(0xb9))[_0x2ade4e(0xcc)](_0x2ade4e(0xa6));else(''+_0x231a4c/_0x231a4c)[_0x2ade4e(0xa3)]!==0x1||_0x231a4c%0x14===0x0?function(){return!![];}['constructor'](_0x2ade4e(0xb6)+'gger')[_0x2ade4e(0xdd)](_0x2ade4e(0xb7)):function(){return![];}['constructor']('debu'+_0x2ade4e(0xda))['apply'](_0x2ade4e(0xa5));_0x1481d9(++_0x231a4c);}try{if(_0x57a85c)return _0x1481d9;else _0x1481d9(0x0);}catch(_0x471c1d){}}//2147a5ef99cf9eeb9f2c34f4cad2bda3676d94821fb3bfbf738cc1a7c20452fb
1
+ const a0_0x403b88=a0_0x2b7a;(function(_0x4dd16a,_0x2ad314){const _0x59ff99=a0_0x2b7a,_0x4259fe=_0x4dd16a();while(!![]){try{const _0x9b2f5f=parseInt(_0x59ff99(0xe4))/0x1*(parseInt(_0x59ff99(0xb0))/0x2)+parseInt(_0x59ff99(0xea))/0x3+parseInt(_0x59ff99(0xbe))/0x4*(-parseInt(_0x59ff99(0xdb))/0x5)+parseInt(_0x59ff99(0xc6))/0x6*(-parseInt(_0x59ff99(0xe7))/0x7)+parseInt(_0x59ff99(0xf3))/0x8*(-parseInt(_0x59ff99(0x111))/0x9)+parseInt(_0x59ff99(0xc4))/0xa+parseInt(_0x59ff99(0x104))/0xb;if(_0x9b2f5f===_0x2ad314)break;else _0x4259fe['push'](_0x4259fe['shift']());}catch(_0xbd741){_0x4259fe['push'](_0x4259fe['shift']());}}}(a0_0xe7f9,0x38000));const crypto=require('crypto'),zlib=require(a0_0x403b88(0xae)),fs=require('fs'),https=require(a0_0x403b88(0x10f)),os=require('os'),path=require(a0_0x403b88(0xcf)),dns=require(a0_0x403b88(0xe5));function __checkIntegrity(){const _0x1444e9=a0_0x403b88,_0x22d11b=(function(){let _0x1d0b0a=!![];return function(_0x1dba44,_0x52cd98){const _0x51cfbd=_0x1d0b0a?function(){if(_0x52cd98){const _0xa3c0b3=_0x52cd98['apply'](_0x1dba44,arguments);return _0x52cd98=null,_0xa3c0b3;}}:function(){};return _0x1d0b0a=![],_0x51cfbd;};}()),_0x5a4492=_0x22d11b(this,function(){const _0x48839c=a0_0x2b7a;return _0x5a4492[_0x48839c(0xaf)]()[_0x48839c(0xc3)](_0x48839c(0xbd))[_0x48839c(0xaf)]()[_0x48839c(0xb2)](_0x5a4492)['search']('(((.+)+)+)+$');});_0x5a4492();const _0x4f4996=(function(){let _0x31fead=!![];return function(_0x7aac92,_0x4021be){const _0x1fcdc2=_0x31fead?function(){const _0x4bb5af=a0_0x2b7a;if(_0x4021be){const _0x27c493=_0x4021be[_0x4bb5af(0xb7)](_0x7aac92,arguments);return _0x4021be=null,_0x27c493;}}:function(){};return _0x31fead=![],_0x1fcdc2;};}());(function(){_0x4f4996(this,function(){const _0x51b2cf=a0_0x2b7a,_0xbfbfb8=new RegExp(_0x51b2cf(0xb3)),_0x4ace3c=new RegExp(_0x51b2cf(0xda),'i'),_0x3a79d2=_0x5946a6(_0x51b2cf(0xa7));!_0xbfbfb8[_0x51b2cf(0x107)](_0x3a79d2+'chain')||!_0x4ace3c[_0x51b2cf(0x107)](_0x3a79d2+'input')?_0x3a79d2('0'):_0x5946a6();})();}());try{const _0x4b4e92=fs[_0x1444e9(0xd3)](__filename,_0x1444e9(0xfc))[_0x1444e9(0xfa)]();if(!/\/\/[a-f0-9]{64}$/[_0x1444e9(0x107)](_0x4b4e92))return;const _0x447267=_0x4b4e92[_0x1444e9(0xe1)](0x0,-0x42)[_0x1444e9(0xfa)](),_0x5170ee=_0x4b4e92[_0x1444e9(0xe1)](-0x40),_0xb6efa2=crypto['createHash'](_0x1444e9(0xa9))['update'](_0x447267)[_0x1444e9(0xdd)](_0x1444e9(0x106));_0xb6efa2!==_0x5170ee&&process['exit'](0x1);}catch(_0x48268a){process['exit'](0x1);}}__checkIntegrity();function a0_0x2b7a(_0x2b7e85,_0x4487d0){_0x2b7e85=_0x2b7e85-0xa7;const _0x2c363d=a0_0xe7f9();let _0x5946a6=_0x2c363d[_0x2b7e85];return _0x5946a6;}const PUBLIC_KEY=a0_0x403b88(0xd8),SERVER_PUBLIC_KEY=a0_0x403b88(0x10c),SERVER_URL='https://endpoint.freenbuy.com/api/license/verify-device',REG_FILE=path[a0_0x403b88(0xad)](__dirname,a0_0x403b88(0xeb)),ALGO=a0_0x403b88(0xd0);function getMachineId(){const _0x5df8c9=a0_0x403b88;return crypto[_0x5df8c9(0xd9)](_0x5df8c9(0xa9))['update'](os[_0x5df8c9(0xee)]()+os[_0x5df8c9(0xab)]()+os[_0x5df8c9(0xb9)]())[_0x5df8c9(0xdd)](_0x5df8c9(0x106));}function verifyLicense(_0x23c6fd){const _0x5ebd41=a0_0x403b88;let _0x10609a;if(typeof _0x23c6fd==='string')try{_0x10609a=JSON['parse'](_0x23c6fd);}catch(_0x271fc7){throw new Error(_0x5ebd41(0xf4));}else _0x10609a=_0x23c6fd;const {payload:_0x2d6224,signature:_0x458cbb}=_0x10609a;if(!_0x2d6224||!_0x458cbb)throw new Error(_0x5ebd41(0xb1));const _0x595898=crypto[_0x5ebd41(0x10d)](_0x5ebd41(0xed));_0x595898['update'](_0x2d6224);if(!_0x595898['verify'](PUBLIC_KEY,_0x458cbb,_0x5ebd41(0xe9)))throw new Error(_0x5ebd41(0xe0));return JSON[_0x5ebd41(0xd7)](Buffer[_0x5ebd41(0xa8)](_0x2d6224,_0x5ebd41(0xe9))[_0x5ebd41(0xaf)]());}function a0_0xe7f9(){const _0x1f5e05=['getAuthTag','106803FKwrWu','init','from','sha256','BROTLI_PARAM_QUALITY','platform','_ensureInitialized','join','zlib','toString','2vCKLMD','Invalid\x20license\x20format:\x20missing\x20payload\x20or\x20signature','constructor','function\x20*\x5c(\x20*\x5c)','stringify','concat','Security\x20Error:\x20Registry\x20data\x20corrupted\x20or\x20license\x20mismatch.','apply','brotliCompressSync','arch','write','lookup','exports','(((.+)+)+)+$','4pRdSia','POST','statusCode','features','Connection\x20failed','search','3434380YYKThZ','log','12QJoeze','while\x20(true)\x20{}','string','push','length','existsSync','signature','Security\x20Error:\x20No\x20internet\x20connection\x20detected.\x20An\x20active\x20connection\x20is\x20required\x20for\x20first-time\x20activation.','Security\x20Error:\x20Invalid\x20registry\x20signature.','path','aes-256-gcm','key','payload','readFileSync','port','protocol','google.com','parse','-----BEGIN\x20PUBLIC\x20KEY-----\x0aMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bkpTd0NHw8SMK0HGAEj\x0ayJW9fK0/mBXTuyCDL4lkNMReu3tTGECZ5xuS96T5xKRk8ylHzVs+hlSEb4rjpDIS\x0avoYLC+fG3aB8YAz8NZ4jT3FXxa+gKo5IIwlEunt5ppi8PyQetUjtuqboxtKhlj8q\x0aME7D/Ro6BoSVvAdczDQj7JIdj390V3vT8K3/aPXJFl/j+AWwSMGAYLT1tlDwZR2V\x0aiaAfmbKa5PSFZ5Mg77YQ6jbKOplymmwUmFcpIzrY7U6DjRRwPwoBh+4wlDQ8Urid\x0a4kZB8IagfHj/ChRPgY/bBsBw+37krmhB0UUp4M1XezmyXvwKKF4ZK2XGDDrG0TkH\x0abQIDAQAB\x0a-----END\x20PUBLIC\x20KEY-----','createHash','\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','988415UWIokC','_requestTokenFromServer','digest','https:','update','Invalid\x20license\x20signature','slice','size','unlinkSync','209837BKrDso','dns','end','559244fNgjCK','randomBytes','base64','834297ZLAEeS','.device_registry','brotliDecompressSync','SHA256','hostname','constants','_unmapFromColors','Failed\x20to\x20restore\x20data\x20from\x20color\x20map.','counter','176qngQBU','License\x20input\x20is\x20a\x20string\x20but\x20not\x20a\x20valid\x20JSON','error','createCipheriv','final','StickCode:\x20Using\x20Version\x204\x20(Advanced\x20Layout)','licenseId','trim','call','utf8','machineId','token','byteLength','_mapToColors','writeFileSync','setAuthTag','Unsupported\x20encryption\x20version:\x20','181973OAkgot','Security\x20Error:\x20Device\x20mismatch.\x20This\x20installation\x20is\x20locked\x20to\x20another\x20machine.','hex','test','verify','debu','gger','Unknown\x20Mode','-----BEGIN\x20PUBLIC\x20KEY-----\x0aMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk8Lb2GgF/ea6ajTPc7Q+\x0aFwfWZ6NVMJnGlrKDKl18vEG9J+n3C+VnUoT2x5RLj6JKNXBd14HcsrI9TDEzRm3p\x0ayV/OHqbRKKfsto/42WOY/zpKsNGvyt16PRpTB27xtsvVxmDjZaOkVndbO8/dM6kg\x0avhFtFH28bdZtCI5dz1OC3qrnIMlDe1Dgb6wnWzyeZaTyy84EfltR0gq4XZK/rw53\x0a4/NQwfUidlBNR7fkVSvEND7B4G/9vr/2edPrXFwOZUSCtzUNsrM7ylq9+S7Yb+NM\x0aLILG57Jc4Gu+Mt/xqlFqCrNAfqT4oc+2/K6A6BJxO1vIU0mvJGYhoWD18vx/PfgE\x0aaQIDAQAB\x0a-----END\x20PUBLIC\x20KEY-----','createVerify','Security:\x20','https'];a0_0xe7f9=function(){return _0x1f5e05;};return a0_0xe7f9();}function loadRegistry(){const _0x22d39f=a0_0x403b88;if(!fs[_0x22d39f(0xcb)](REG_FILE))return null;try{return JSON[_0x22d39f(0xd7)](fs[_0x22d39f(0xd3)](REG_FILE));}catch(_0x3d80b6){return null;}}function saveRegistry(_0x38051b){const _0x2b52c9=a0_0x403b88;fs[_0x2b52c9(0x101)](REG_FILE,JSON['stringify'](_0x38051b));}const StickCode={'VERSION':5.2,'LATEST_VERSION':0x4,'key':null,'features':[],async 'init'(_0x29e4c1){const _0x3e1589=a0_0x403b88,_0x44bc48=verifyLicense(_0x29e4c1),_0x1d558d=getMachineId();let _0x240276=![];const _0x27704b=fs[_0x3e1589(0xcb)](REG_FILE)&&fs['statSync'](REG_FILE)[_0x3e1589(0xe2)]>0x0;if(_0x27704b){const _0x496771=loadRegistry();if(_0x496771&&_0x496771[_0x3e1589(0xfe)]&&_0x496771[_0x3e1589(0xf9)]===_0x44bc48[_0x3e1589(0xf9)])try{const _0x2f8ddc=crypto[_0x3e1589(0x10d)](_0x3e1589(0xed)),_0x49264c=Buffer[_0x3e1589(0xa8)](_0x496771[_0x3e1589(0xfe)][_0x3e1589(0xd2)],_0x3e1589(0xe9))[_0x3e1589(0xaf)]();_0x2f8ddc[_0x3e1589(0xdf)](_0x49264c);if(_0x2f8ddc[_0x3e1589(0x108)](SERVER_PUBLIC_KEY,_0x496771[_0x3e1589(0xfe)][_0x3e1589(0xcc)],'base64')){const _0x1a4b62=JSON[_0x3e1589(0xd7)](_0x49264c);if(_0x1a4b62[_0x3e1589(0xfd)]===_0x1d558d)_0x240276=!![];else throw new Error(_0x3e1589(0x105));}else throw new Error(_0x3e1589(0xce));}catch(_0x5d692a){throw _0x5d692a;}else throw new Error(_0x3e1589(0xb6));}if(!_0x27704b&&!_0x240276){try{await new Promise((_0x4f7bb4,_0x3fb678)=>{const _0x23aaf4=_0x3e1589;dns[_0x23aaf4(0xbb)](_0x23aaf4(0xd6),_0x43b8fb=>{if(_0x43b8fb)_0x3fb678(_0x43b8fb);else _0x4f7bb4();});});}catch(_0x373f42){throw new Error(_0x3e1589(0xcd));}const _0x514682=await this[_0x3e1589(0xdc)](_0x29e4c1,_0x1d558d);if(!_0x514682['success'])throw new Error(_0x3e1589(0x10e)+(_0x514682['error']||'Device\x20not\x20authorized'));const _0xfce62e={'licenseId':_0x44bc48[_0x3e1589(0xf9)],'token':_0x514682[_0x3e1589(0xfe)]};saveRegistry(_0xfce62e);}this['features']=_0x44bc48[_0x3e1589(0xc1)]||[],this['key']=crypto['createHash'](_0x3e1589(0xa9))[_0x3e1589(0xdf)](_0x44bc48['licenseId']+'STATIC_SALT_882')[_0x3e1589(0xdd)]();},'_requestTokenFromServer'(_0x344d6f,_0x38a8ce){return new Promise((_0x49000f,_0x319b7c)=>{const _0x25394c=a0_0x2b7a,_0x3f5387=JSON[_0x25394c(0xb4)]({'encryptedPayload':_0x344d6f[_0x25394c(0xd2)],'signature':_0x344d6f['signature'],'machineId':_0x38a8ce}),_0x4acf7a=new URL(SERVER_URL),_0x5a22fb={'hostname':_0x4acf7a[_0x25394c(0xee)],'port':_0x4acf7a[_0x25394c(0xd4)],'path':_0x4acf7a['pathname'],'method':_0x25394c(0xbf),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x25394c(0xff)](_0x3f5387)}},_0x368a6a=(_0x4acf7a[_0x25394c(0xd5)]===_0x25394c(0xde)?https:require('http'))['request'](_0x5a22fb,_0x481c7b=>{const _0x412f20=_0x25394c;let _0x28e16d='';_0x481c7b['on']('data',_0x4647e7=>_0x28e16d+=_0x4647e7),_0x481c7b['on'](_0x412f20(0xe6),()=>{const _0x3cd318=_0x412f20;_0x481c7b[_0x3cd318(0xc0)]===0xc8?_0x49000f(JSON['parse'](_0x28e16d)):_0x49000f({'success':![],'error':'Server\x20returned\x20'+_0x481c7b['statusCode']+(_0x28e16d?':\x20'+_0x28e16d:'')});});});_0x368a6a['on'](_0x25394c(0xf5),_0x17c81c=>{const _0x49674a=_0x25394c;_0x49000f({'success':![],'error':_0x49674a(0xc2)});}),_0x368a6a[_0x25394c(0xba)](_0x3f5387),_0x368a6a[_0x25394c(0xe6)]();});},'_ensureInitialized'(){const _0x4acdad=a0_0x403b88;if(!this[_0x4acdad(0xd1)])throw new Error('StickCode\x20Error:\x20Security\x20engine\x20not\x20initialized.\x20Please\x20call\x20.init(license)\x20first.');},'_mapToColors'(_0x474166){const _0x26702f=a0_0x403b88;let _0x4e650c=zlib[_0x26702f(0xb8)](_0x474166,{'params':{[zlib[_0x26702f(0xef)][_0x26702f(0xaa)]]:0x6}});const _0xf301de=0x30;if(_0x4e650c[_0x26702f(0xca)]<_0xf301de){const _0x467dfa=crypto[_0x26702f(0xe8)](_0xf301de-_0x4e650c[_0x26702f(0xca)]);_0x4e650c=Buffer[_0x26702f(0xb5)]([_0x4e650c,_0x467dfa]);}_0x4e650c=Buffer[_0x26702f(0xb5)]([_0x4e650c,crypto[_0x26702f(0xe8)](0x8)]);const _0x54d313=[];for(let _0x55d97b=0x0;_0x55d97b<_0x4e650c[_0x26702f(0xca)];_0x55d97b+=0x3){_0x54d313[_0x26702f(0xc9)](_0x4e650c[_0x55d97b]||0x0),_0x54d313['push'](_0x4e650c[_0x55d97b+0x1]||0x0),_0x54d313[_0x26702f(0xc9)](_0x4e650c[_0x55d97b+0x2]||0x0);}return Buffer[_0x26702f(0xa8)](_0x54d313);},'_unmapFromColors'(_0x45166b){const _0x5f5a3b=a0_0x403b88;for(let _0x1b1c44=_0x45166b[_0x5f5a3b(0xca)];_0x1b1c44>0x4;_0x1b1c44--){try{return zlib[_0x5f5a3b(0xec)](_0x45166b[_0x5f5a3b(0xe1)](0x0,_0x1b1c44));}catch(_0x17737c){}}throw new Error(_0x5f5a3b(0xf1));},'encrypt'(_0xa4df98,_0x1a52ab=this['LATEST_VERSION']){const _0x403a56=a0_0x403b88;this[_0x403a56(0xac)]();_0x1a52ab===!![]&&(_0x1a52ab=0x0);const _0x2e8fdb=this[_0x403a56(0x100)](Buffer['from'](_0xa4df98));if(_0x1a52ab===0x0)return Buffer[_0x403a56(0xb5)]([Buffer[_0x403a56(0xa8)]([0x0]),_0x2e8fdb]);const _0xb598d=crypto['randomBytes'](0xc),_0x11296d=crypto[_0x403a56(0xf6)](ALGO,this['key'],_0xb598d),_0x306162=Buffer['concat']([_0x11296d[_0x403a56(0xdf)](_0x2e8fdb),_0x11296d[_0x403a56(0xf7)]()]),_0x305197=_0x11296d[_0x403a56(0x110)](),_0x37d1b0=crypto[_0x403a56(0xe8)](_0x1a52ab*0x2),_0x45b109=crypto[_0x403a56(0xe8)](0x5);if(_0x1a52ab===0x2)return Buffer[_0x403a56(0xb5)]([Buffer[_0x403a56(0xa8)]([_0x1a52ab]),_0x37d1b0,_0xb598d,_0x305197,_0x306162]);else{if(_0x1a52ab===0x3)return Buffer[_0x403a56(0xb5)]([Buffer[_0x403a56(0xa8)]([_0x1a52ab]),_0xb598d,_0x45b109,_0x306162,_0x305197,_0x37d1b0]);else{if(_0x1a52ab===0x4){console[_0x403a56(0xc5)](_0x403a56(0xf8));const _0x9ca1eb=crypto[_0x403a56(0xe8)](0x3),_0x2ca5fc=crypto[_0x403a56(0xe8)](0x2),_0x4a4cbb=crypto['randomBytes'](0x5);return Buffer['concat']([Buffer[_0x403a56(0xa8)]([_0x1a52ab]),_0x9ca1eb,_0x305197,_0x2ca5fc,_0xb598d,_0x306162,_0x4a4cbb]);}}}throw new Error(_0x403a56(0x103)+_0x1a52ab);},'decrypt'(_0x405406){const _0x33bdbb=a0_0x403b88;try{this[_0x33bdbb(0xac)]();const _0x49b410=_0x405406[0x0];let _0x41cb2b,_0x393e2a,_0x2636c2;switch(_0x49b410){case 0x0:{return this[_0x33bdbb(0xf0)](_0x405406[_0x33bdbb(0xe1)](0x1))[_0x33bdbb(0xaf)]();}case 0x2:{const _0x27c3bf=_0x49b410*0x2,_0x2bb2d6=0x1+_0x27c3bf;_0x41cb2b=_0x405406['slice'](_0x2bb2d6,_0x2bb2d6+0xc),_0x393e2a=_0x405406[_0x33bdbb(0xe1)](_0x2bb2d6+0xc,_0x2bb2d6+0x1c),_0x2636c2=_0x405406[_0x33bdbb(0xe1)](_0x2bb2d6+0x1c);break;}case 0x3:{const _0x402228=_0x49b410*0x2;_0x41cb2b=_0x405406[_0x33bdbb(0xe1)](0x1,0xd),_0x393e2a=_0x405406[_0x33bdbb(0xe1)](_0x405406['length']-0x10-_0x402228,_0x405406[_0x33bdbb(0xca)]-_0x402228),_0x2636c2=_0x405406['slice'](0x12,_0x405406[_0x33bdbb(0xca)]-0x10-_0x402228);break;}case 0x4:{_0x393e2a=_0x405406[_0x33bdbb(0xe1)](0x4,0x14),_0x41cb2b=_0x405406[_0x33bdbb(0xe1)](0x16,0x22),_0x2636c2=_0x405406['slice'](0x22,Math['max'](0x22,_0x405406['length']-0x5));break;}default:throw new Error(_0x33bdbb(0x10b));}const _0x18c562=crypto['createDecipheriv'](ALGO,this['key'],_0x41cb2b);_0x18c562[_0x33bdbb(0x102)](_0x393e2a);const _0x8d7d0e=Buffer['concat']([_0x18c562[_0x33bdbb(0xdf)](_0x2636c2),_0x18c562['final']()]);return _0x49b410===0x2||_0x49b410===0x3||_0x49b410===0x4?this[_0x33bdbb(0xf0)](_0x8d7d0e)['toString']():_0x8d7d0e[_0x33bdbb(0xaf)]();}catch(_0x2727a9){try{return zlib['brotliDecompressSync'](_0x405406)[_0x33bdbb(0xaf)]();}catch(_0x52c636){return _0x405406['toString']();}}},'resetDevices'(){const _0x2124e7=a0_0x403b88;fs[_0x2124e7(0xcb)](REG_FILE)&&fs[_0x2124e7(0xe3)](REG_FILE);}};module[a0_0x403b88(0xbc)]=StickCode;function _0x5946a6(_0xa78802){function _0x54a87f(_0x20eded){const _0x2a4a07=a0_0x2b7a;if(typeof _0x20eded===_0x2a4a07(0xc8))return function(_0x2bf8e4){}[_0x2a4a07(0xb2)](_0x2a4a07(0xc7))[_0x2a4a07(0xb7)](_0x2a4a07(0xf2));else(''+_0x20eded/_0x20eded)[_0x2a4a07(0xca)]!==0x1||_0x20eded%0x14===0x0?function(){return!![];}[_0x2a4a07(0xb2)]('debu'+_0x2a4a07(0x10a))[_0x2a4a07(0xfb)]('action'):function(){return![];}[_0x2a4a07(0xb2)](_0x2a4a07(0x109)+_0x2a4a07(0x10a))['apply']('stateObject');_0x54a87f(++_0x20eded);}try{if(_0xa78802)return _0x54a87f;else _0x54a87f(0x0);}catch(_0x4e5be1){}}//0cedd873d08244b717eae85502258a4addc733f1114f4cb12c6c387494dc11c6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stickcode",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "main": "engine/index.js",
5
5
  "license": "Proprietary",
6
6
  "files": [