blob: 1a4672573393ed369e0af515d24754b43df7f703 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# XOR-Crypt
[](http://travis-ci.org/RobLoach/xor-crypt "Check this project's build status on TravisCI")
[](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)
|