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 🙏

© 2025 – Pkg Stats / Ryan Hefner

novice-webcrypto

v1.0.6

Published

A simple wrapper for the browser's Web Crypto API. Supports AES-GCM, RSA, and ECDSA (P-256), exposing easy-to-use functions where all keys are safe Base64 strings.

Readme

novice-webcrypto

Simplify browser cryptography with safe, easy-to-use TypeScript classes.
Built for developers who dislike the verbose native Web Crypto API.
Every key is a Base64-safe string — easy to store, transfer, and reuse.


Features

  • AES-GCM symmetric encryption/decryption
  • RSA-OAEP encryption / RSASSA-PKCS1-v1_5 signature
  • ECDSA (P-256) signature and verification
  • Key generation and import/export as Base64 strings
  • Zero crypto dependencies — uses native Web Crypto API

Installation

npm install novice-webcrypto

or

pnpm add novice-webcrypto


Example Usage

AES-GCM Encryption & Decryption

import { AES } from "novice-webcrypto";

// Generate a new AES key
const key = await AES.generateKey();

// Encrypt
const { iv, ciphertext } = await AES.encrypt(key, "Hello World");

// Decrypt
const plaintext = await AES.decrypt(key, iv, ciphertext);
console.log(plaintext); // Hello World\

ECDSA Sign & Verify

import { ECDSA } from "novice-webcrypto";

const { publicKey, privateKey } = await ECDSA.generateKeyPair();

const message = "Important message";
const signature = await ECDSA.sign(privateKey, message);

const valid = await ECDSA.verify(publicKey, message, signature);
console.log(valid); // true

RSA Encryption Example

import { RSA } from "novice-webcrypto";

const { publicKey, privateKey } = await RSA.generateKeyPair();

const plaintext = "Secret message";
const ciphertext = await RSA.encrypt(publicKey, plaintext);

const decrypted = await RSA.decrypt(privateKey, ciphertext);
console.log(decrypted); // Secret message

API Summary

  • AES.generateKey() → base64 key

  • AES.encrypt(base64Key, plaintext) → { iv, ciphertext }

  • AES.decrypt(base64Key, iv, ciphertext) → plaintext

  • ECDSA.generateKeyPair() → { publicKey, privateKey } (base64 JWK)

  • ECDSA.sign(privateKey, message) → signature (base64)

  • ECDSA.verify(publicKey, message, signature) → boolean

  • RSA.generateKeyPair() → { publicKey, privateKey } (base64 PEM or JWK)

  • RSA.encrypt(publicKey, plaintext) → ciphertext (base64)

  • RSA.decrypt(privateKey, ciphertext) → plaintext


License

MIT License © 2025 Lê Minh Quân