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

@darco2903/simple-encrypt

v0.4.5

Published

Simple Encrypt is a simple encryption library for Node.js based on the built-in `crypto` module that provides a simple API for encrypting and decrypting data using AES. It also provides a CLI for generating keys and encrypting/decrypting files. It exposes

Readme

Simple Encrypt

Description

Simple Encrypt is a simple encryption library for Node.js based on the built-in crypto module that provides a simple API for encrypting and decrypting data using AES. It also provides a CLI for generating keys and encrypting/decrypting files. It exposes two classes, AES-256-CBC and AES_256_CTR, which implement the AES encryption algorithm in CBC and CTR modes respectively. The library also provides a EncryptKey class for generating and managing encryption keys.

Features

  • Key generation and management
  • CLI for key generation
  • AES-256-CBC and AES_256_CTR encryption and decryption
  • Encryption and decryption of data and files
  • Encryption and decryption of streams
  • AES_256_CTR class supports chunked encryption and decryption, allowing you to decrypt only a portion of a file without having to decrypt the entire file

Installation

npm install @darco2903/simple-encrypt

Usage

Key Generation

import { EncryptKey } from "@darco2903/simple-encrypt";

// Generate a key
const key = EncryptKey.generate();
console.log("Key generated");

// Save the key to a json file
await key.toHexFile("key.json");
console.log("Key saved to key.json");

Load Key

import { EncryptKey } from "@darco2903/simple-encrypt";

// Load the key
const keyFromFile = await EncryptKey.fromHexFile("key.json");
console.log("Key loaded from key.json");

// Load the key from a hex string
const keyFromHex = EncryptKey.fromHex(KEY, IV);
console.log("Key loaded from hex string");

Encryption / Decryption

import { AES_256_CBC, EncryptKey } from "@darco2903/simple-encrypt";

const key = EncryptKey.generate();
const se = new AES_256_CBC(key);

const data = Buffer.from("Hello World");
const encrypted = se.encrypt(data);
console.log("Encrypted:", encrypted); // <Buffer ...>

const decrypted = se.decrypt(encrypted);
console.log("Decrypted:", decrypted.toString()); // "Hello World"

CLI

NPM

npx simple-encrypt [command] [options]

PNPM

pnpm exec simple-encrypt [command] [options]

General

| Option | Description | | ------ | --------------- | | -h | Display help | | -v | Display version |

Key Generation

npx simple-encrypt generate [options]

| Option | Default | Description | Required | | ------ | ------- | ----------- | -------- | | -B | 32 | Key length | | | -s | | Save path | |

:warning: A key length different from 32 will not work with the encryption and decryption.

Examples

Generate a key and save it to key.json

npx simple-encrypt generate -s key.json
// or
pnpm exec simple-encrypt generate -s key.json