Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panthershark/string-obfuscator
Encodes and Decodes (encrypts and decrypts) strings. Supports random length encoded values.
https://github.com/panthershark/string-obfuscator
Last synced: about 2 months ago
JSON representation
Encodes and Decodes (encrypts and decrypts) strings. Supports random length encoded values.
- Host: GitHub
- URL: https://github.com/panthershark/string-obfuscator
- Owner: panthershark
- License: mit
- Created: 2015-05-05T23:04:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-06T15:24:40.000Z (over 9 years ago)
- Last Synced: 2024-04-15T14:27:07.024Z (9 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# string-obfuscator
Encodes and Decodes (encrypts and decrypts) strings. Supports random length encoded values.# Usage
```
var Obfuscator = require('string-obfuscator');
var obfuscator = new Obfuscator({
algorithm: 'aes-256-ctr',
password: 'WhoLetTheDogsOut?!',
random_length: true
});var str = 'I let the dogs out.';
var encoded = obfuscator.encode(str);
console.log(encoded); // ==> random length encoded stringvar decoded = obfuscator.decode(encoded);
assert.equal(decoded, str, 'Strings match'); // ==> trueconsole.log(decoded); // ==> 'I let the dogs out.'
```# Configuration
* algorithm: {string} Valid string from ```crypto.getCiphers();```
* password: {string} The password used for the cipher. (see crypto lib)
* random_length: {boolean} If true, then a random length padding is added to the value before encrypting. This will produce n variations of the encoded string. If false, then the value is simply encrypted using the algorithm and password.