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

deny-sh

v2.3.1

Published

Deniable encryption. One ciphertext, two passwords, two completely different plaintexts.

Readme

deny-sh

Deniable encryption. One ciphertext, two passwords, two completely different plaintexts. Both mathematically valid. When the bytes leak, what leaks is the decoy.

deny.sh · Whitepaper · Verify it yourself · Other SDKs

What this is

The TypeScript / Node.js SDK + CLI for deny.sh, the deniability infrastructure. This package is the Encrypt pillar: the cryptographic primitive, Apache 2.0, free for any use, embeddable in any product, proprietary or open.

npm install deny-sh

Small (~10KB minified). One runtime dependency (hash-wasm for portable Argon2id; lets the SDK run in Node.js, browsers, and Chrome MV3 service workers without polyfills). AES-256-CTR via node:crypto and the Web Crypto API.

How it works

plaintext + password1 + password2 → ciphertext + control_data

ciphertext + control_data + passwords → original plaintext  ✓
ciphertext + fake_control + passwords → decoy plaintext     ✓

Both decryptions succeed. Both produce valid output. There is no mathematical marker, no hidden flag, no forensic trace that distinguishes one from the other. The attacker got a plaintext. They can never prove it wasn't the plaintext.

Under the hood:

  1. Key derivation via Argon2id (t=3, m=64 MiB, p=1, v=0x13) from two passwords
  2. 4-byte LE length prefix + plaintext, XORed with random control data
  3. AES-256-CTR encryption
  4. Output: salt (32B) | IV (16B) | ciphertext

Creating a decoy is just running the maths in reverse with different plaintext. New control data falls out. Same ciphertext. Different truth.

Quick start

import {
  encrypt,
  decrypt,
  generateDeniableControl,
  generateControlData,
} from 'deny-sh';

const real  = new TextEncoder().encode('the actual secret');
const decoy = new TextEncoder().encode('a plausible cover story');
const password1 = 'real password';
const password2 = 'duress password';

// 1. Allocate random control data sized to the inner payload (plaintext + 4 bytes)
const controlData = generateControlData(real.length + 4);

// 2. Encrypt the real plaintext
const { ciphertext } = encrypt(real, { password1, password2, controlData });

// 3. Derive a decoy control file that decrypts the SAME ciphertext to the decoy
const { controlData: decoyControl } = generateDeniableControl(
  ciphertext,
  password1,
  password2,
  decoy
);

// Both decryptions succeed
const { plaintext: outReal  } = decrypt(ciphertext, { password1, password2, controlData });
const { plaintext: outDecoy } = decrypt(ciphertext, { password1, password2, controlData: decoyControl });

The controlData and decoyControl blobs are indistinguishable. Whoever holds the ciphertext can be presented with either control file plus the matching passwords and will decrypt to a valid plaintext. There is no way for them to know which one came first.

The primitive is intentionally unauthenticated. Wrong passwords return garbage, not an error. Add a caller-side integrity check (magic bytes plus a SHA-256 fingerprint on the plaintext) if you need decryption to fail loudly on the wrong inputs. See https://deny.sh/security for the construction write-up.

CLI

deny-sh protect                                # interactive seed-phrase protection wizard
deny-sh init                                   # set up .deny/ in cwd
deny-sh env protect .env                       # encrypt a .env file -> .env.deny
deny-sh env restore .env.deny                  # restore an encrypted .env file
deny-sh vault set|get|list|delete KEY [value]  # local encrypted key-value store
deny-sh 1p push|pull|list|status               # 1Password integration
deny-sh bw push|pull|list|status               # Bitwarden integration
deny-sh backup push|pull|list|config|auto      # cloud backup helpers (S3, rclone)
deny-sh verify                                 # run encryption/deniability test suite
deny-sh status                                 # show .deny/ state and version info

Run deny-sh --help for the full surface.

Agent integration — deny-sh/client

Thin HTTP client for fetching a credential from the deny.sh managed vault inside an AI agent's tool boundary. The credential is decrypted on your server, used to call the third-party API, and the LLM only ever sees the API result. The Stripe key (or any other secret) never enters the model's context window, so a successful prompt injection cannot exfiltrate it.

import { vaultGet } from 'deny-sh/client';

const stripeKey = await vaultGet('stripe-prod', process.env.VAULT_PW!);
// use stripeKey inside the tool, never return it to the model

Configure via env: DENY_API_KEY (your bearer key, required), DENY_API_URL (default https://deny.sh/api). Use vaultGetById(id, password) if you have stored the stable id of the vault item to skip the label lookup. See deny.sh/integrations for full Vercel AI SDK, OpenAI Responses, and LangChain examples.

Other languages

| Language | Package | Repo | |--------------|---------------|------| | TypeScript | deny-sh | deny-sh-crypto/deny-js (this repo) | | Python | deny-sh | deny-sh-crypto/deny-python | | Rust | deny-sh | deny-sh-crypto/deny-rs | | Go | deny-go/v2 | deny-sh-crypto/deny-go (import path: github.com/deny-sh-crypto/deny-go/v2) |

All four are algorithm-compatible: a ciphertext produced by one decrypts cleanly under the others.

Verify the deniability claim

git clone https://github.com/deny-sh-crypto/deny-js
cd deny-js
npm install
npm run build
npm run verify

run-verification.mjs runs the cryptographic verification suite end-to-end and prints results. The full mathematical argument is in the whitepaper.

Threat model

deny.sh defends against passive ciphertext leak scenarios: someone obtains your encrypted file (cloud breach, lost laptop, seized device) and tries to read it.

It is not designed to resist an adaptive adversary who can compel you to perform multiple decryptions, demand additional passwords iteratively, or run forensic side-channel analysis on your decryption hardware. See the whitepaper §5 for the full threat model.

License

Apache License 2.0. See LICENSE.

Free for commercial and proprietary use. No copyleft, no attribution beyond the standard Apache notice, no legal review required for embedding in closed-source projects.

The deny.sh application layer (vault, dead-man's switch, MCP server, hosted API, web UI) remains under AGPL-3.0. The cryptographic primitive in this SDK is Apache 2.0. See deny.sh/licensing for the full split.

Audit status

External cryptographic audit is on the roadmap. Firm and scope will be announced once engaged. Until then: read the code, run the verification suite, read the whitepaper, draw your own conclusions.

Reporting vulnerabilities

Found a bug in the crypto, the SDK, or the CLI? Email [email protected] (PGP fingerprint and disclosure policy at deny.sh/disclosure). Please give us a reasonable window before public disclosure.