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

@ideadesignmedia/encryption

v1.0.3

Published

Lightweight AES-256-CTR helpers for Node.js with both programmatic and CLI interfaces.

Readme

encryption

Lightweight AES-256-CTR helpers for Node.js with both programmatic and CLI interfaces.

Source repository: https://github.com/ideadesignmedia/encryption

Install

npm install @ideadesignmedia/encryption

Quick start (Node.js)

const { encrypt, decrypt, randomString, KEY_LENGTH, IV_LENGTH } = require('@ideadesignmedia/encryption')

const key = randomString(KEY_LENGTH) // 32 ASCII characters; supply your own for production
const iv = '1234567891011121'        // Must be 16 ASCII characters; update before shipping anything sensitive

const ciphertext = encrypt('hello world', key, iv)
console.log(ciphertext) // => hex encoded string

const plainText = decrypt(ciphertext, key, iv)
console.log(plainText) // => 'hello world'

Notes:

  • Keys must be exactly KEY_LENGTH (32) ASCII characters (or a Buffer of 32 bytes) and initialization vectors must be IV_LENGTH (16) ASCII characters (Buffer of 16 bytes).
  • Inputs to encrypt should be UTF-8 strings; decrypt expects a hex string produced by this package.
  • randomString(length) returns a numeric string of the requested length; bring your own cryptographic key management for production secrets.
  • Bundled TypeScript definitions export the helpers and constants shown above for ergonomic imports.

TypeScript example

import { encrypt, decrypt, KEY_LENGTH, IV_LENGTH } from '@ideadesignmedia/encryption'

const key = '0123456789abcdef0123456789abcdef' // KEY_LENGTH = 32
const iv = '1234567891011121'                  // IV_LENGTH = 16

const cipher = encrypt('typed usage', key, iv)
const plain = decrypt(cipher, key, iv)

CLI usage

# Encrypt plain text (writes hex ciphertext to stdout)
npx @ideadesignmedia/encryption encrypt "super secret" 0123456789abcdef0123456789abcdef 1234567891011121

# Decrypt the ciphertext (writes plain text to stdout)
npx @ideadesignmedia/encryption decrypt <hex-string> 0123456789abcdef0123456789abcdef 1234567891011121

Run npx @ideadesignmedia/encryption --help for inline usage information. Leaving the key and IV arguments empty uses the built-in defaults (intended for local testing only).

Remember: CLI string inputs for key and iv must be exactly 32 and 16 characters respectively (ASCII). Provide Buffers when working with non-ASCII data.

API reference

| Function | Description | | --- | --- | | encrypt(value, key?, iv?) | Encrypts a UTF-8 string using AES-256-CTR; returns a hex string. | | decrypt(ciphertext, key?, iv?) | Decrypts a hex string generated by encrypt; returns a UTF-8 string. | | randomString(length?) | Creates a numeric string of the supplied length (default 32). | | KEY_LENGTH / IV_LENGTH | Exported constants so you can validate your own keys and IVs. |

Development

npm install
npm test

# Quick sanity check
node -e "const {encrypt, decrypt} = require('./'); const out = encrypt('demo'); console.log(out, decrypt(out));"