Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
niceware-ts
Advanced tools
Niceware-TS is a TypeScript implementation of Niceware, a method for generating or converting random bytes into English language passphrases.
Niceware-TS is a TypeScript implementation of Niceware, a method for generating or converting random bytes into English language passphrases. This library provides functions for generating random passphrases with a specified number of bytes of entropy, as well as converting passphrases to and from byte arrays.
Each word in the passphrase provides 16 bits of entropy, so a secure passphrase
should consist of at least 3 words. With a wordlist containing 2^16
(65,536
)
words, Niceware is suitable for
converting cryptographic keys. For example, a key with 128 bits of entropy is
equivalent to an 8 word passphrase.
Niceware can be used for a variety of purposes, including generating secure and easy-to-remember passphrases and displaying cryptographic key material in a user-friendly way. A passphrase consisting of 3-5 Niceware words provides 64 bits of randomness, making it a strong password for most online services. Additionally, an 8-word Niceware phrase can be used to reconstruct an entire public/private key pair for cryptographic purposes, such as generating a 256-bit ECC key (equivalent to a 3072-bit RSA key).
Web Demo: https://diracdeltas.github.io/niceware/
Uint8Array
s, padding the outputTo use Niceware-TS in your TypeScript/ESM/CommonJS project, simply install it from npm:
npm install niceware-ts
Then, import the functions you need from the module:
import { bytesToPassphrase, generatePassphrase, passphraseToBytes } from 'niceware-ts';
// Generate a passphrase with 16 bytes (128 bits) of entropy
const passphrase = generatePassphrase(16);
// Convert the passphrase to a byte array
const bytes = passphraseToBytes(passphrase);
console.log(passphrase.join(' ')); // Output: "deadpanned steamily penuriously geometry elusion trainload camelback inexcusable"
console.log(bytes); // Uint8Array(16) [ 50, 222, 213, 47, 158, 168, 89, 37, 67, 191, 229, 223, 27, 197, 109, 85 ]
console.log(bytesToPassphrase(bytes).join(' ')); // Output: "deadpanned steamily penuriously geometry elusion trainload camelback inexcusable"
Niceware-TS is licensed under the MIT License. See LICENSE for more information.
Many thanks to Yan for creating Niceware.
FAQs
Niceware-TS is a TypeScript implementation of Niceware, a method for generating or converting random bytes into English language passphrases.
The npm package niceware-ts receives a total of 309 weekly downloads. As such, niceware-ts popularity was classified as not popular.
We found that niceware-ts 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.