https://github.com/slavahatnuke/cryptr-token
https://github.com/slavahatnuke/cryptr-token
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/slavahatnuke/cryptr-token
- Owner: slavahatnuke
- Created: 2019-09-09T09:51:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:35:52.000Z (over 2 years ago)
- Last Synced: 2025-03-12T13:02:35.203Z (2 months ago)
- Language: JavaScript
- Size: 1.68 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cryptr-token
cryptr-token is a simple aes-256-ctr token module for node.js
```javascript
const secret = 'secret$$$$here'
const {encrypt} = Cipher(secret)
const {decrypt} = Cipher(secret)const input = {message: 'hello'}
const token = encrypt(input);
console.log('input', input);
console.log('token', token);const ouptput = decrypt(token)
console.log('ouptput', ouptput);
assert.deepEqual(input, ouptput)
```### Output
```
input { message: 'hello' }
token dceVmpYL5MHit3B1HI4gEDw67aE6gjby4onKrKJRoy769qI
ouptput { message: 'hello' }
```