OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

ethereum-cryptography

ethereum-cryptography is an MIT-licensed TypeScript library that exposes Ethereum-related cryptographic primitives through JavaScript submodules. It includes hashing, key derivation, secure random data, elliptic-curve operations, encryption, BIP-32 keys and BIP-39 mnemonic functions for use in browser and Node.js applications.

Independent OpenViST project profile, based on linked sources.

ethereum-cryptography — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a JavaScript or TypeScript application needs specific Ethereum-related cryptographic operations and its runtime fits the documented support. Import the relevant submodule rather than relying on a single package-wide entry point.

Who it is for

  • JavaScript and TypeScript developers building Ethereum-related applications.
  • Teams that need selected cryptographic primitives in browser or Node.js code.

Documented uses

  • Hash byte data using functions such as SHA-256 or Keccak.
  • Derive keys with PBKDF2 or scrypt.
  • Generate secure random data or perform secp256k1 public-key, signing and verification operations.
  • Use documented encryption, HD-key and mnemonic modules in application code.
Before you choose

Requirements & limits

The package is open source under the MIT license and is installed through npm.

  • The README explicitly supports major browsers and Node.js on x86 and arm64; support for other major runtimes and platforms is best-effort.
  • The library has separate submodules for primitives rather than one entry point.
  • The package re-exports six noble and scure dependencies and recommends pinning the package version in consuming applications.
  • Synchronous PBKDF2 and scrypt can block a browser’s main thread; asynchronous functions are also documented.
  • The AES documentation says not to use a password directly as an AES key and recommends deriving a strong key.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install the library and select a cryptographic module

Add the package to a JavaScript or TypeScript project and import a specific primitive.

Before you start

  • A JavaScript or TypeScript project using npm.

Steps

  1. Install the package with the command below.

    Documented command
    npm install ethereum-cryptography
  2. Import the needed function from its documented submodule, such as sha256 from ethereum-cryptography/sha256.js.

  3. Pass the documented input type, such as a Uint8Array; use the utilities submodule to convert strings to bytes when needed.

Expected outcome

The application can call the selected cryptographic primitive without importing a single all-in-one entry point.

Guide limitations

  • Major browsers and Node.js on x86 and arm64 are explicitly supported; other runtimes and platforms are best-effort.
  • For browser use with Rollup, the README specifies CommonJS and node-resolve plugins and a browser-oriented resolution configuration.
Source-based practical guide

Derive a key asynchronously with PBKDF2

Use the documented PBKDF2 module to derive key bytes from a password and salt.

Before you start

  • The installed ethereum-cryptography package.
  • Password and salt represented as Uint8Array values, or converted to bytes with the utilities module.

Steps

  1. Import pbkdf2 from ethereum-cryptography/pbkdf2.js and utf8ToBytes from ethereum-cryptography/utils.js.

  2. Convert the password and salt to byte arrays if they are strings.

  3. Call the asynchronous function with the password bytes, salt bytes, iteration count, output length and digest; the README example uses 131072 iterations, 32 output bytes and SHA-256.

Expected outcome

PBKDF2 returns derived key bytes for the application to use.

Guide limitations

  • The README describes PBKDF2 as very slow and advises against its synchronous variant in browsers because it can block the main thread.
  • The documentation cautions that password encoding is a frequent source of errors and directs users to review its encoding notes.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
9 October 2026
Original website title
ethereum/js-ethereum-cryptography · Official homepage title · retained in its source language