gost-kryptoken
v1.0.1
Published
gost crypto data (encrypt & decrypt) and JWT for security
Downloads
112
Maintainers
Readme
gost-kryptoken
GOST crypto and JWT for security
Installation
npm install --save gost-kryptoken
import gost from 'gost-kryptoken'
sign
const message = 'message to encrypt'
const secret = 'your-secret-key'
const expiry = 3600
const token = gost.sign(message, secret, expiry)
returns token
dekrypt
const message = 'message to encrypt'
const secret = 'your-secret-key'
const token = gost.dekrypt(token, secret)
returns decoded data
verify
const message = 'message to encrypt'
const secret = 'your-secret-key'
const token = gost.verify(token, secret)
returns boolean valid=>true expired=>false
--Code updated by [email protected]{P}