Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
basic-noise
Advanced tools
## Usage ```js const Noise = require('basic-noise') const initiator = new Noise('IK ', true) const responder = new Noise('IK', false)
const Noise = require('basic-noise')
const initiator = new Noise('IK ', true)
const responder = new Noise('IK', false)
const prologue = Buffer.alloc(0)
// preshared key
initiator.initialise(prologue, responder.s.pub)
responder.initialise(prologue)
// -> e, es, s, ss
const message = initiator.send()
responder.recv(message)
// <- e, ee, se
const reply = responder.send()
initiator.recv(reply)
console.log(initiator.handshakeComplete) // true
const msg = Buffer.from('hello, world')
const enc = initiator.rx.encrypt(msg)
console.log(responder.tx.decrypt(enc)) // hello, world
const peer = new Noise(pattern, initiator, staticKeypair)
Create a new handshake state for a given pattern. Initiator should be either true
or false
depending on the role. A preexisting keypair may be passed as staticKeypair
peer.initialise(prologue, remoteStatic)
Initialise the handshake state with a prologue and any preshared keys.
const buf = send([payload])
Send the next message in the handshake, add an optional payload buffer to be included in the message, payload is a zero length buffer by default.
const payload = peer.recv(buf)
Receive a handshake message from the peer and return the encrypted payload.
peer.handshakeComplete
true
or false
. Indicates whether rx
and tx
have been created yet.
const ciphertext = peer.rx.encrypt(plaintext, [ad])
Encrypt a message to the remote peer with an optional authenticated data passed in as ad
.
const plaintext = peer.tx.decrypt(ciphertext, [ad])
Decrypt a ciphertext from the remote peer. Note initiator.rx
is decrypted by responder.tx
and vice versa. If the message was encrypted with authenticated data, this must be passed in as ad
otherwise decryption shall fail
FAQs
## Usage ```js const Noise = require('basic-noise') const initiator = new Noise('IK ', true) const responder = new Noise('IK', false)
We found that basic-noise 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.