Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A big integer library for JS, based on Leemon, with focus on prime numbers and cryptography
#BigJS This is my big integer library, it is built on top of the big int library built by Leemon Baird.
I built it for my own interests in cryptography. It was built as Leemon's library polluted the global scope and had a somewhat scattered design. I especially love the implementations that were done for finding primes. Enjoy!
number
- the actual number, this can be a string, a JS number, or another BI object
base
- this defaults to 10
// If you're using npm, otherwise BI is part of the window objects
var BI = require('bigjs');
var b = new BI(16772625);
//Or
var b = new BI("FFEE11", 16);
//If you put a BI object in the constructor a deep copy of that number is made
var foo = new BI(b);
//foo is now a BI object with the value 0xFFEE11
base
- this also defaults to 10
var b = new BI(16772625).toString(16);
//b is now the string "FFEE11"
this only works by translating whatever is in the big int to a JS number. It's called whenever the object is involved in a numerical operation.
var b = (new BI(10)) * 2
//b is now 20
BI.ONE == 1
BI.ZERO == 0
bits
- bit size of the prime, anything over 2048bits is rather slow on most machines
probable
- determines whether or not this is a true prime or a probable prime. Setting this to true means that 1 in every 2^80 numbers generated may be composite. However, it has a speed up of about 10x compared to the true prime.
BI.prime(2048) //Generates a 2048 bit true prime encapsulated in the BI object
var b = new BI(1997);
b.add(19);
// Returns a new big int object with a value of 2016
b.add(19, true);
// Returns the current big int object, b, with its value changed to 2016
var b = new BI(2016);
b.subtract(19);
// Returns a new big int object with a value of 1997
b.subtract(19, true);
// Returns the current big int object, b, with its value changed to 1997
var b = new BI(8);
b.multiply(7);
// Returns a new big int object with a value of 56
b.multiply(7, true);
// Returns the current big int object, b, with its value changed to 56
this is a synonym of .multiply()
FAQs
A big integer library for JS, based on Leemon, with focus on prime numbers and cryptography
The npm package bigjs receives a total of 85 weekly downloads. As such, bigjs popularity was classified as not popular.
We found that bigjs 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.