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

@luisotaviopilotto/cryptmp

v1.0.1

Published

Password hashing with a temporal pepper (SHA-3 family). Interoperable with the Go and Python implementations.

Readme

Cryptmp — Node.js

Implementação em Node.js com node:crypto nativo (zero dependências). Interoperável com as versões Go e Python: um hash gerado aqui verifica lá e vice-versa, com a mesma chave global.

Requer Node 16+ (OpenSSL 1.1.1+, para sha3-256 e shake256).

Instalação

npm install @luisotaviopilotto/cryptmp

O comando acima só funciona depois que o pacote estiver publicado no npm. Enquanto não publicar, dá para instalar do jeito local — mesmo nome, mesmo require('@luisotaviopilotto/cryptmp'):

# a) direto da pasta do projeto
npm install /caminho/para/cryptmp-js

# b) via tarball (gera luisotaviopilotto-cryptmp-1.0.0.tgz)
cd cryptmp-js && npm pack
npm install /caminho/para/luisotaviopilotto-cryptmp-1.0.0.tgz

# c) direto do GitHub
npm install git+https://github.com/luisotaviopilotto/cryptmp-js.git

Publicar no npm

cd cryptmp-js
npm login
npm publish --access public   # pacotes com escopo são privados por padrão

Uso

const th = require('@luisotaviopilotto/cryptmp'); // ou require('./cryptmp') local

// 1. Chave global de 32 bytes — de um segredo, nunca do banco.
const key = th.Key.fromHex(1, '…64 hex chars…'); // ou th.Key.generate(1)
const kr = new th.Keyring(key);

// 2. Hasher (calibre o custo).
const hasher = new th.Cryptmp(kr, { cost: 12 });

// 3. Cadastro / login.
const encoded = hasher.hash('minha_senha');          // grave no banco
const ok = hasher.verify('minha_senha', encoded);    // true

// 4. Upgrade transparente.
if (ok && hasher.needsRehash(encoded)) {
  // regrave hasher.hash('minha_senha')
}

Rotação de chave

const k1 = th.Key.fromHex(1, '…antiga…');
const k2 = th.Key.generate(2);
const kr = new th.Keyring(k2, k1);        // k2 ativa, k1 legada
const hasher = new th.Cryptmp(kr, { cost: 12 });
hasher.verify(pw, hashAntigo);            // acha k1 pelo keyid automaticamente

CLI

export CRYPTMP_KEY=$(node bin/cryptmp.js gen-key)
printf 'minha_senha' | node bin/cryptmp.js hash --cost 12
node bin/cryptmp.js verify '$th$1$12$1$...' 'minha_senha'

Com o pacote instalado, o binário cryptmp fica disponível via npx:

npx cryptmp gen-key

Testes

npm test        # ou: node test.js  (KAT + roundtrip)

Os vetores em vectors.json são idênticos aos das versões Go e Python.

⚠️ Construção educacional/de pesquisa, não auditada. Para produção prefira argon2/scrypt. Modelo de segurança e limitações no README do cryptmp-go.