Gathering detailed insights and metrics for jwt-simple
Gathering detailed insights and metrics for jwt-simple
Gathering detailed insights and metrics for jwt-simple
Gathering detailed insights and metrics for jwt-simple
JWT(JSON Web Token) encode and decode module for node.js
npm install jwt-simple
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.9
Supply Chain
84
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
66,611,791
Last Day
9,607
Last Week
132,158
Last Month
794,183
Last Year
10,684,164
1,364 Stars
82 Commits
135 Forks
31 Watching
1 Branches
20 Contributors
Latest Version
0.5.6
Package Id
jwt-simple@0.5.6
Size
3.63 kB
NPM Version
6.4.1
Node Version
10.15.1
Publised On
30 Mar 2019
Cumulative downloads
Total Downloads
Last day
-75.6%
9,607
Compared to previous day
Last week
-35%
132,158
Compared to previous week
Last month
-9.6%
794,183
Compared to previous month
Last year
2.5%
10,684,164
Compared to previous year
JWT(JSON Web Token) encode and decode module for node.js.
$ npm install jwt-simple
1var jwt = require('jwt-simple'); 2var payload = { foo: 'bar' }; 3var secret = 'xxx'; 4 5// HS256 secrets are typically 128-bit random strings, for example hex-encoded: 6// var secret = Buffer.from('fe1a1915a379f3be5394b64d14794932', 'hex') 7 8// encode 9var token = jwt.encode(payload, secret); 10 11// decode 12var decoded = jwt.decode(token, secret); 13console.log(decoded); //=> { foo: 'bar' }
1/* 2 * jwt.decode(token, key, noVerify, algorithm) 3 */ 4 5// decode, by default the signature of the token is verified 6var decoded = jwt.decode(token, secret); 7console.log(decoded); //=> { foo: 'bar' } 8 9// decode without verify the signature of the token, 10// be sure to KNOW WHAT ARE YOU DOING because not verify the signature 11// means you can't be sure that someone hasn't modified the token payload 12var decoded = jwt.decode(token, secret, true); 13console.log(decoded); //=> { foo: 'bar' } 14 15// decode with a specific algorithm (not using the algorithm described in the token payload) 16var decoded = jwt.decode(token, secret, false, 'HS256'); 17console.log(decoded); //=> { foo: 'bar' }
By default the algorithm to encode is HS256
.
The supported algorithms for encoding and decoding are HS256
, HS384
, HS512
and RS256
.
1// encode using HS512 2jwt.encode(payload, secret, 'HS512')
Stable Version
1
0/10
Summary
Forgeable Public/Private Tokens in jwt-simple
Affected Versions
< 0.3.1
Patched Versions
0.3.1
1
0/10
Summary
Signature Verification Bypass in jwt-simple
Affected Versions
< 0.5.3
Patched Versions
0.5.3
1
0/10
Summary
Withdrawn
Affected Versions
< 0.3.1
Patched Versions
0.3.1
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/17 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
33 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More