@molay/salter
v0.1.3-alpha-0
Published
A JavaScript code salter.
Downloads
2
Readme
Salter
A JavaScript code salter :)
Currently this tool only supports algorithm "ALPHA-0" for experimental usage.
CAUTION: THIS PROJECT IS STILL NOT MATURE, DO NOT USE THIS FOR HIGH LEVEL SECURITY PROJECTS !
Salt
const fs = require('fs');
const Salter = require('@molay/salter').default;
const code = fs.readFileSync('./example-code.js', 'utf-8');
const salter = new Salter({});
const info = 'This is a secret.';
const saltedCode = salter.salt(code, {
type: 'alpha-0',
signature: info,
mangle: true,
// Backward compatible with IE9+
// Valid value: 'ie9', 'ie10', 'ie11', 'edge' or empty
compatibility: 'ie9'
});
fs.writeFileSync('./example-code-salted.js', saltedCode, 'utf-8');
Extract
const fs = require('fs');
const Extractor = require('@molay/salter').Extractor;
const saltedCode = fs.readFileSync('./example-code-salted.js', 'utf-8');
const extractor = new Extractor({});
const info = extractor.extract(saltedCode, {
type: 'alpha-0',
});
console.log(info);