https://github.com/hex2f/keylock
Lock stuff with keys.
https://github.com/hex2f/keylock
Last synced: about 1 year ago
JSON representation
Lock stuff with keys.
- Host: GitHub
- URL: https://github.com/hex2f/keylock
- Owner: hex2f
- Created: 2018-06-27T18:39:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T18:42:27.000Z (almost 8 years ago)
- Last Synced: 2025-03-23T07:33:39.151Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KeyLock
## Lock stuff with keys.
KeyLock is a neat little wrapper around the built-in nodejs crypto module.
### Well, how do i use it?
Install it `npm i keylock`
Require it `const KeyLock = require('keylock')`
Initialize it `const lock = new KeyLock('some password')`
Lock something `const locked = lock.lock('secret message')`
Unlock something `const unlocked = lock.unlock(locked)`
### More Detail
#### Parameters
| Function | Arguments |
| ------------- | --------------- |
| new KeyLock | key[, options] |
| .newKey | key[, options] |
| .lock | data[, options] |
| .unlock | data[, options] |
#### Options?
| Option | Example |
| --------------------- | ------------------------- |
| algoritm | aes-256-cbc, aes192, rc2 |
| inputEncoding | binary, utf8, hex |
| outputEncoding | binary, utf8, hex |
| key (.unlock & .lock) | cool password, some key |