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

lucipher

v4.0.2

Published

LUCipher (Let Us Cipher) — isomorphic authenticated encryption (AES-256-GCM + PBKDF2) for Node and the browser

Readme

lucipher (Let Us Cipher) GitHub version

🌐 manufosela.dev/lucipher — la historia y evolución del proyecto.

Librería isomorfa de cifrado autenticado: el mismo código corre en Node y en el navegador usando la Web Crypto API (crypto.subtle).

Desde la v4 el diseño es:

  • AES-256-GCM (AEAD): confidencialidad e integridad. Cualquier manipulación del texto cifrado se detecta al descifrar (la promesa se rechaza, no devuelve datos corruptos).
  • PBKDF2-SHA256 (600 000 iteraciones) como derivación de clave.
  • salt e IV aleatorios por mensaje: cifrar dos veces el mismo texto produce siempre una salida distinta.
  • Padding de longitud variable autenticado: oculta parcialmente la longitud real del mensaje sin corromper los datos.
  • Contenedor autodescriptivo (versión · salt · iv · ciphertext+tag en base64): para descifrar solo necesitas la contraseña.
  • Formato universal: un texto cifrado en Node se descifra en el navegador y viceversa.
  • API asíncrona: cipher/desCipher devuelven promesas (Web Crypto es async).

Requiere Node ≥ 19 o un navegador moderno en contexto seguro (HTTPS o localhost), donde globalThis.crypto.subtle está disponible.

Versiones

| Versión | Entorno | Primitivas | Notas | |---------|---------|------------|-------| | 4.0.0 | Node ≥ 19 y navegador | AES-256-GCM + PBKDF2 | Recomendada. Core isomorfo e interoperable. API asíncrona. | | 3.0.x | Solo Node ≥ 16 | ChaCha20-Poly1305 + scrypt | API síncrona. Además lee textos cifrados con v2. | | 2.2.x | Node y navegador | AES-128-CBC + "ruido" | Legacy, insegura (IV fijo, sin integridad). No usar. |

Cada versión mayor cambia el formato del texto cifrado y no es interoperable con las anteriores al cifrar. Para leer textos antiguos, usa la versión con la que se cifraron. Historial completo en el CHANGELOG.

Instalación

$ npm i lucipher

En Node, con ES modules:

import LUCipher from 'lucipher';

const password = 'una-contraseña-fuerte';
const luc = new LUCipher(password);

const code = await luc.cipher('texto a cifrar');

try {
  const decode = await luc.desCipher(code);
  console.log(decode); // 'texto a cifrar'
} catch {
  // El texto está manipulado, corrupto o la contraseña es incorrecta
}

O con CommonJS:

const LUCipher = require('lucipher').default;

const luc = new LUCipher('una-contraseña-fuerte');
const code = await luc.cipher('texto a cifrar');
const decode = await luc.desCipher(code);

En el navegador, como módulo ESM (sin bundle), por CDN o desde node_modules:

<script type="module">
  // Por CDN:
  import LUCipher from 'https://esm.sh/lucipher';
  // ...o desde node_modules servido por tu bundler/servidor:
  // import LUCipher from '/node_modules/lucipher/index.mjs';

  const luc = new LUCipher('una-contraseña-fuerte');
  const code = await luc.cipher('texto a cifrar');
  const decode = await luc.desCipher(code); // descifra también lo cifrado en Node
</script>

Breaking changes (v3 → v4)

La v4 es un cambio mayor. Si vienes de v3:

  • API asíncrona: cipher y desCipher ahora devuelven promesas. Añade await (o .then).
  • Formato nuevo (v4), no interoperable con v3 al cifrar. v4 solo lee textos v4; para leer textos v2/v3 antiguos, mantén una instancia de la versión 3.0.x.
  • Cambio de primitivas: de ChaCha20-Poly1305 + scrypt (Node) a AES-256-GCM + PBKDF2 (comunes a Node y navegador). Es el precio de la interoperabilidad: PBKDF2 es menos resistente a hardware dedicado que scrypt (mitigado con 600 000 iteraciones).
  • Ya no depende de node:crypto ni del build browserify: un único core isomorfo.
  • Requisito de entorno: Node ≥ 19 o navegador moderno en contexto seguro.

Notas de seguridad

  • No incrustes contraseñas en URLs ni en query strings: quedan en logs de servidor, proxies e historial.
  • crypto.subtle solo está disponible en contextos seguros (HTTPS o localhost).
  • PBKDF2 protege la contraseña con 600 000 iteraciones; aun así, usa contraseñas fuertes.