New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

anacl

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anacl

TweetNaCl.js fork for asynchronous PRNGs

latest
Source
npmnpm
Version
1.0.3-1
Version published
Maintainers
1
Created
Source

anacl-js

Build Status

A TweetNaCl.js fork for asynchronous PRNGs.

The following methods which rely on the asynchronous PRNG are changed to return Promise:

  • nacl.randomBytes
  • nacl.box.keyPair
  • nacl.sign.keyPair

The followings are the default PRNGs used, depending on the platform anacl runs on:

  • window.crypto.getRandomValues (WebCrypto standard)
  • window.msCrypto.getRandomValues (Internet Explorer 11)
  • crypto.randomBytes (Node.js)
  • wx.getRandomValues (WeChat)

If the above are not available on the platform you are targeting, and you have a cryptographically-strong source of entropy, you can plug it in like this:

nacl.setPRNG(function(x, n) {
  // ... copy n random bytes into x, synchronously or asynchronously (return a promise) ...
});

Other than the above, check TweetNaCl.js for usage in general.

Keywords

crypto

FAQs

Package last updated on 22 Jun 2021

Did you know?

Socket

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.

Install

Related posts