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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kiwa-lab/crypto

v2.1.0

Published

Cryptographic mock harness for kiwa — JWT (RS256/HS256/ES256) / RSA / AES (CBC/GCM) / hash (sha256/512/blake2) / HMAC / X.509 cert parse を統一 interface で in-process 実行する test infra。 real crypto library 差替なしで sign / verify / encrypt / decrypt / hash / cert

Readme

@kiwa-lab/crypto

Cryptographic operation harness for kiwa — JWT / RSA / AES / hash / HMAC / X.509 を統一 interface で叩ける test infra (node:crypto ラッパー)。

Installation

pnpm add -D @kiwa-lab/crypto
# or
npm install -D @kiwa-lab/crypto
# or
yarn add -D @kiwa-lab/crypto

Supported primitives

| Primitive | Algorithms | Primary API | |---|---|---| | JWT | HS256 / RS256 / ES256 | signJWT / verifyJWT | | RSA | sign / verify / encrypt / decrypt | rsaSign / rsaVerify | | AES | CBC / GCM | aesEncrypt / aesDecrypt | | hash | sha256 / sha512 / blake2 | hashData | | HMAC | sha256 / sha512 | hmacDigest | | X.509 | parse | parseX509 |

Quick start

import { describe, expect, it } from 'vitest';
import { signJWT, verifyJWT, hashData, aesEncrypt, aesDecrypt } from '@kiwa-lab/crypto';

describe('auth pipeline', () => {
  it('JWT sign+verify + AES-GCM roundtrip', async () => {
    const token = signJWT({ sub: 'u-1' }, { algorithm: 'HS256', secret: 's' });
    const verified = verifyJWT(token, { algorithm: 'HS256', secret: 's' });
    expect(verified.valid).toBe(true);
    const key = hashData('password', { algorithm: 'sha256' }).slice(0, 32);
    const enc = aesEncrypt('payload', { mode: 'gcm', key });
    const dec = aesDecrypt(enc.ciphertext, { mode: 'gcm', key, iv: enc.iv, authTag: enc.authTag });
    expect(dec).toBe('payload');
  });
});

API reference

  • signJWT(payload: JWTPayload, options): string — HS256/RS256/ES256 sign
  • verifyJWT(token, options): JWTVerifyResult — signature + claim 検証
  • rsaSign(data, { privateKey }) / rsaVerify(data, sig, { publicKey }) — RSA sign/verify
  • aesEncrypt(plaintext, { mode, key }) / aesDecrypt(ct, { mode, key, iv }) — CBC/GCM
  • hashData(input, { algorithm: HashAlgorithm }): string — sha256/sha512/blake2
  • hmacDigest(data, { algorithm: HmacAlgorithm, secret }): string — HMAC digest
  • parseX509(pem: string): X509CertInfo — 証明書 metadata 抽出
  • generateKeyPair(type: KeyPairType): KeyPairResult — RSA/EC keypair

Test integration

vitest + /kiwa-crypto skill で auth / session / webhook signature の暗号処理を deterministic に verify。

License

UNLICENSED — see github.com/cardene777/kiwa.