gost-kryptoken

1.0.1 • Public • Published

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 godofsoftwaret@gmail.com-MK-3794-{P}

Package Sidebar

Install

npm i gost-kryptoken

Weekly Downloads

13

Version

1.0.1

License

MIT

Unpacked Size

3.1 kB

Total Files

6

Last publish

Collaborators

  • gost1