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

@lindorm/enigma

v0.4.1

Published

Argon2id password hashing for Node.js, plus a layered `Enigma` helper that combines HMAC signing, Argon2 hashing, and AES encryption into a single `hash` / `verify` / `assert` interface.

Readme

@lindorm/enigma

Argon2id password hashing for Node.js, plus a layered Enigma helper that combines HMAC signing, Argon2 hashing, and AES encryption into a single hash / verify / assert interface.

Installation

npm install @lindorm/enigma

This package is ESM-only. Import it with import; CommonJS require is not supported.

Features

  • ArgonKit — thin wrapper around argon2 with configurable hashLength, memoryCost, parallelism, and timeCost.
  • Optional Argon2 pepper sourced from a @lindorm/kryptos OCT key (the key's private bytes are passed through as the Argon2 secret).
  • Enigma — layered helper that signs the input via OctKit, hashes the signature with ArgonKit, then encrypts the hash with AesKit.
  • hash, verify, and assert semantics on both kits. assert rejects with a typed error (ArgonError or EnigmaError) on mismatch.

Usage

ArgonKit

import { ArgonKit } from "@lindorm/enigma";

const kit = new ArgonKit();

const hash = await kit.hash("super-secret");

await kit.verify("super-secret", hash); // true
await kit.assert("super-secret", hash); // resolves
await kit.assert("wrong", hash); // throws ArgonError

With a pepper

ArgonKit accepts an optional IKryptosOct. The OCT key's private material is forwarded to Argon2 as the secret parameter (commonly called a pepper). The constructor throws OctError from @lindorm/oct if the supplied key is not an OCT key.

import { ArgonKit } from "@lindorm/enigma";
import { KryptosKit } from "@lindorm/kryptos";

const kryptos = KryptosKit.generate.sig.oct({ algorithm: "HS256" });

const kit = new ArgonKit({ kryptos });

const hash = await kit.hash("super-secret");

Enigma

Enigma chains three layers: HMAC sign → Argon2 hash → AES encrypt. hash returns the AES ciphertext; verify reverses the layers.

import { Enigma } from "@lindorm/enigma";
import { KryptosKit } from "@lindorm/kryptos";

const aesKryptos = KryptosKit.generate.enc.oct({
  algorithm: "dir",
  encryption: "A256GCM",
});
const octKryptos = KryptosKit.generate.sig.oct({ algorithm: "HS256" });

const enigma = new Enigma({
  aes: { kryptos: aesKryptos },
  oct: { kryptos: octKryptos },
});

const hash = await enigma.hash("super-secret");

await enigma.verify("super-secret", hash); // true
await enigma.assert("wrong", hash); // throws EnigmaError

Enigma accepts an optional argon block that is forwarded to the inner ArgonKit:

const enigma = new Enigma({
  aes: { kryptos: aesKryptos },
  oct: { kryptos: octKryptos },
  argon: { hashLength: 128, memoryCost: 131072, timeCost: 16 },
});

API

class ArgonKit

new ArgonKit(options?: ArgonKitOptions).

| Option | Type | Default | Notes | | ------------- | ------------- | ------- | ---------------------------------------------------------------------------------- | | hashLength | number | 256 | Argon2 output length in bytes. | | memoryCost | number | 65536 | Memory in KiB. | | parallelism | number | 8 | Number of Argon2 lanes (threads). | | timeCost | number | 12 | Number of iterations. | | kryptos | IKryptosOct | — | Optional OCT key whose DER private bytes are used as the Argon2 secret (pepper). |

Methods (all async):

  • hash(data: string): Promise<string> — returns an Argon2id encoded hash string.
  • verify(data: string, hash: string): Promise<boolean>true when data matches hash.
  • assert(data: string, hash: string): Promise<void> — rejects with ArgonError when verification fails.

class Enigma

new Enigma(options: EnigmaOptions).

EnigmaOptions:

| Field | Type | Required | Notes | | ------- | ----------------- | -------- | --------------------------------------------------------------------------------------------- | | aes | AesKitOptions | yes | Forwarded to AesKit from @lindorm/aes. Must include a kryptos key suitable for AES. | | oct | OctKitOptions | yes | Forwarded to OctKit from @lindorm/oct. Must include a kryptos OCT key for HMAC signing. | | argon | ArgonKitOptions | no | Forwarded to the inner ArgonKit (see above). |

Methods (all async):

  • hash(data: string): Promise<string> — sign → Argon2 hash → AES encrypt.
  • verify(data: string, hash: string): Promise<boolean> — reverses the layers.
  • assert(data: string, hash: string): Promise<void> — rejects with EnigmaError on mismatch.

Errors

  • ArgonError — thrown when ArgonKit#assert fails verification, and when a pepper key is supplied without exportable private bytes.
  • EnigmaError — thrown when Enigma#assert fails verification.

Both extend LindormError from @lindorm/errors.

Exported types

ArgonKitOptions, EnigmaOptions, CreateArgonHashOptions, and VerifyArgonHashOptions are exported from the package root.

License

AGPL-3.0-or-later