Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
HORNSAT is a restricted version of the boolean satisfiability problem where all clauses are written in Horn normal form. The programming lanugage Prolog uses HORNSAT internally to solve many constraint problems. This modules implements Dowling and Gallier's linear time algorithm:
This code should work both in node.js and in the browser via browserify.
var hornSAT = require("horn-sat")
// Horn clauses are encoded as pairs. For example, the clause:
// (x1 & x2 => x3)
// Becomes:
// [ [0,1], 2 ]
// For clauses that map to false, use -1 for the head of the clause:
// (x1 => 0)
// Becomes:
// [[0], -1]
//
//
// For example, let's solve the problem:
//
// x1 & (x1 & x3 => x2) & (x1 => x2) & (x1 & x2 & x3 => 0) & (x1 & x3 & x4 => 0) & (x3 & x2 => x4) & (x4 & x5 => 0)
//
console.log(hornSAT(5,
[
[[], 0], // x1
[[0,2], 1], // x1 & x3 => x2
[[0], 1], // x1 => x2
[[0,1,2], -1], // x1 & x2 & x3 => 0
[[0,2,3], -1], // x1 & x3 & x4 => 0
[[2,1], 3], // x3 & x2 => x4
[[3,4], -1] // x4 & x5 => 0
]
))
// Prints out:
//
// [ true, true, false, false, false ]
//
npm install horn-sat
require("horn-sat")(numVariables, clauses)
Finds a satisfying assignment of variables to the HORNSAT instance
numVariables
is the number of variables in the problemclauses
is an array of clauses, encoded as described in the exampleReturns An assignment of variables that solves the Horn SAT instance, or else false
if the problem is not satisfiable.
(c) 2013 Mikola Lysenko. MIT License
FAQs
Solves HORNSAT
The npm package horn-sat receives a total of 1 weekly downloads. As such, horn-sat popularity was classified as not popular.
We found that horn-sat 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.