npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@peculiar/webcrypto

v1.5.0

Published

A WebCrypto Polyfill for NodeJS

Downloads

12,078,227

Readme

@peculiar/webcrypto

License test Coverage Status npm version

We wanted to be able to write Javascript that used crypto on both the client and the server but we did not want to rely on Javascript implementations of crypto. The only native cryptography available in browser is Web Crypto, this resulted in us creating a @peculiar/webcrypto.

Table Of Contents

WARNING

At this time this solution should be considered suitable for research and experimentation, further code and security review is needed before utilization in a production application.

Module is based on NodeJS v10 Crypto API. It would work only with Node v10 and higher.

Installing

npm install @peculiar/webcrypto

Supported algorithms

| Algorithm name | generateKey | digest | export/import | sign/verify | encrypt/decrypt | wrapKey/unwrapKey | derive | |-------------------|-------------|---------|---------------|-------------|-----------------|-------------------|---------| | SHA-1 | | X | | | | | | | SHA-256 | | X | | | | | | | SHA-384 | | X | | | | | | | SHA-512 | | X | | | | | | | HMAC | X | | X | X | | | | | RSASSA-PKCS1-v1_5 | X | | X | X | | | | | RSAES-PKCS1-v1_52| X | | X | | X | X | | | RSA-PSS | X | | X | X | | | | | RSA-OAEP | X | | X | | X | X | | | AES-CMAC | X | | X | X | | | | | AES-CBC | X | | X | | X | X | | | AES-CTR | X | | X | | X | X | | | AES-ECB | X | | X | | X | X | | | AES-GCM | X | | X | | X | X | | | AES-KW | X | | X | | | X | | | ECDSA1 | X | | X | X | | | | | ECDH1 | X | | X | | | | X | | EdDSA2,3 | X | | X | X | | | | | ECDH-ES2,4 | X | | X | | | | X | | HKDF | | | X | | | | X | | PBKDF2 | | | X | | | | X | | DES-CBC2| X | | X | | X | X | | | DES-EDE3-CBC2| X | | X | | X | X | | | shake1282| | X | | | | | | | shake2562| | X | | | | | |

1 Mechanism supports extended list of named curves P-256, P-384, P-521, K-256, brainpoolP160r1, brainpoolP160t1, brainpoolP192r1, brainpoolP192t1, brainpoolP224r1, brainpoolP224t1, brainpoolP256r1, brainpoolP256t1, brainpoolP320r1, brainpoolP320t1, brainpoolP384r1, brainpoolP384t1, brainpoolP512r1, and brainpoolP512t1

2 Mechanism is not defined by the WebCrypto specifications. Use of mechanism in a safe way is hard, it was added for the purpose of enabling interoperability with an existing system. We recommend against its use unless needed for interoperability.

3 Mechanism supports extended list of named curves Ed25519, and Ed448

4 Mechanism supports extended list of named curves X25519, and X448

Using

const { Crypto } = require("@peculiar/webcrypto");

const crypto = new Crypto();

Examples

See WebCrypto Docs for examples

Bug Reporting

Please report bugs either as pull requests or as issues in the issue tracker. @peculiar/webcrypto has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.

Related