https://github.com/robloach/xor-crypt
:symbols: Simple JavaScript XOR string encryption library
https://github.com/robloach/xor-crypt
Last synced: 7 months ago
JSON representation
:symbols: Simple JavaScript XOR string encryption library
- Host: GitHub
- URL: https://github.com/robloach/xor-crypt
- Owner: RobLoach
- License: other
- Created: 2015-02-03T19:02:25.000Z (over 11 years ago)
- Default Branch: gh-pages
- Last Pushed: 2018-07-29T22:18:30.000Z (almost 8 years ago)
- Last Synced: 2025-03-30T18:02:09.716Z (about 1 year ago)
- Language: HTML
- Homepage: http://robloach.github.io/xor-crypt/
- Size: 19.5 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# XOR-Crypt
[](https://travis-ci.org/RobLoach/xor-crypt)
[](https://npmjs.org/package/xor-crypt "View this project on NPM")
[](https://npmjs.org/package/xor-crypt "View this project on NPM")
[](https://david-dm.org/RobLoach/xor-crypt)
[](https://david-dm.org/RobLoach/xor-crypt#info=devDependencies)
Simple XOR string encryption library.
## Install
### [NPM](http://npmjs.org/)
- Use: `require('xor-crypt')`
- Install: `npm install --save xor-crypt`
### [Browserify](http://browserify.org/)
- Use: `require('xor-crypt')`
- Install: `npm install --save xor-crypt`
- CDN URL: `//wzrd.in/bundle/xor-crypt@0.0.2`
### [Ender](http://ender.jit.su/)
- Use: `require('xor-crypt')`
- Install: `ender add xor-crypt`
### [Component](http://github.com/component/component)
- Use: `require('xor-crypt')`
- Install: `component install RobLoach/xor-crypt`
### [Bower](http://bower.io/)
- Use: `require('xor-crypt')`
- Install: `bower install xor-crypt`
## Usage
See the [XOR-Crypt demonstration](http://robloach.github.io/xor-crypt/) for a
live usage of XOR-Crypt.
``` javascript
var encrypted = xorCrypt('Hello World');
// Outputs: Ncjji&Qitjb
var decrypted = xorCrypt(encrypted);
// Outputs: Hello World
// Use your own XOR Key.
var encrypted = xorCrypt('Hello World', 9);
var decrypted = xorCrypt(encrypted, 9);
```
## Development
Install dependencies through [npm](http://npmjs.org):
npm install
Test with [ESLint](http://eslint.org), [Mocha](http://mochajs.org) and [Mocha
JSDom](https://github.com/rstacruz/mocha-jsdom):
npm test
Build `xor-crypt.min.js` with:
npm run build
Tag and publish the new versions to [npm](http://npmjs.com) with [Semantic
Versioning](http://semver.org/):
git tag 2.0.0
git push origin 2.0.0
npm publish
## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/RobLoach/xor-crypt/blob/master/HISTORY.md#files)
## License
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://opensource.org/licenses/MIT)