
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
A better, faster, lighter and more secure alternative to jsonwebtoken
To install jssign
# with npm:
npm install jssign --save
# with yarn:
yarn add jssign
# with pnpm:
pnpm add jssign
# with bun:
bun add jssign
jssign exports different functions for data encryption for different use cases:
For a faster (but less secure) encoding and decoding of data using a secret, jssign exports the following functions:
sign(data, secret, options): returns encoded tokenverify(token, secret): returns decoded dataimport { sign, verify } from 'jssign'
const secret = 'top-secret'
const token = sign({ foo: 'bar' }, secret, { sl: 16 }) // no expiration
const data = verify(token, secret)
console.log(data) // { foo: 'bar' }
data can be an object literal, buffer or string representing valid JSON.
secret can be a string
options:
expiresIn can be a numeric value representing time in ms (no expiration by default).sl can be a numberic value representing salt length (default value is 32). Salt is a random string which is added on top of data to keep the token different everytime even for the same data.For a more secure (but slower) encryption and decryption of data using a secret, jssign exports the following functions that uses sjcl under the hood:
encrypt(data, secret, options, sjclOptions): return encrypted tokendecrypt(token, secret): returns decrypted dataimport { encrypt, decrypt } from 'jssign'
const secret = 'top-secret'
const token = encrypt({ id: 'confidential_data' }, secret, { expiresIn: 180000 }) // will expire after 30 minutes of token creation
const data = decrypt(token, secret)
console.log(data) // { id: 'confidential_data' }
data can be an object literal, buffer or string representing valid JSON.
secret can be a string
options:
expiresIn can be a numeric value representing time in ms (no expiration by default).sjclOptions are the options taken by sjcl.encrypt method having type SjclCipherEncryptParams
FAQs
A token generator library to encode and decode data using a secret key
The npm package jssign receives a total of 1 weekly downloads. As such, jssign popularity was classified as not popular.
We found that jssign demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.