1.0.4 • Published 9 months ago

crypted-jwt v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Crypted JWT

This small library hashes the generated regular JWT keys with three different numbers and enables you to parse it later on. If you don't share these numbers with anyone, it becomes nearly impossible to crack.

Installation

npm install crypted-jwt
or
yarn add crypted-jwt

Usage

const CJWT = require('crypted-jwt')

// Firstly, we send settings in this way and create a Class.
// salt1, salt2, and salt3 determine your encryption keys. Do not share these with anyone!
const options = {
    salt1: 10,
    salt2: 20,
    salt3: 30,
    jsonSecretKey: 'string',
    expiresIn: '365d',
    cryptoSecretKey: 'only 32 character string'
}

// Create Class
const CJ = new CJWT(options)

// It generates a hashed token for you by sending the object as a payload.
const token = CJ.createToken({ id: 1 })

// You can query the generated token when it arrives at the service later on.
const bearerToken = 'testtoken'
const parse = CJ.parseToken(bearerToken)

Good Works.

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago