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

zetacrypt

v1.0.1

Published

A simple substitution cipher for encrypting and decrypting passwords.

Readme

ZetaCrypt

ZetaCrypt is a lightweight JavaScript library that implements a substitution cipher with a key-based shuffling algorithm for encrypting and decrypting passwords. It uses a custom alphabet and a pseudo-random shuffling mechanism to provide a simple yet effective way to secure sensitive data. Ideal for developers looking to add basic encryption to their Node.js applications.

Features

  • Key-Based Encryption: Uses a user-provided key to generate a unique substitution map for encryption and decryption.
  • Custom Alphabet: Supports a wide range of characters, including lowercase, uppercase, numbers, and special characters.
  • Reversible Cipher: Ensures encrypted passwords can be decrypted back to their original form using the same key.
  • No External Dependencies: Pure JavaScript implementation, making it lightweight and easy to integrate.
  • Deterministic Output: The same key and input always produce the same encrypted output, ensuring consistency.

Installation

Install ZetaCrypt via npm:

npm install zetacrypt

Usage

Here's a quick example to get you started with ZetaCrypt:

const ZetaCrypt = require('zetacrypt');

// Initialize with a secret key
const crypt = new ZetaCrypt('mySecretKey');

// Encrypt a password
const encrypted = crypt.encryptPassword('Hello123!');
console.log('Encrypted:', encrypted); // Outputs encrypted string

// Decrypt the password
const decrypted = crypt.decryptPassword(encrypted);
console.log('Decrypted:', decrypted); // Outputs: Hello123!

API Documentation

ZetaCrypt(key)

Constructor that initializes the cipher with a key.

  • key (string): The secret key used to generate the substitution map and shift for encryption/decryption.

encryptPassword(password)

Encrypts the provided password using the substitution cipher and a shift based on the key.

  • password (string): The input string to encrypt.
  • Returns (string): The encrypted string.
  • Note: Characters not in the supported alphabet (a-z, A-Z, 0-9, !@#$%^&*()) are preserved unchanged.

decryptPassword(encryptedPassword)

Decrypts the provided encrypted password back to its original form.

  • encryptedPassword (string): The encrypted string to decrypt.
  • Returns (string): The decrypted original string.
  • Note: Requires the same key used for encryption to correctly decrypt.

Example Use Cases

Securing User Passwords

Use ZetaCrypt to encrypt sensitive user input, such as passwords, before storing them in a database:

const ZetaCrypt = require('zetacrypt');
const crypt = new ZetaCrypt('secureKey123');

const userPassword = 'MyP@ssw0rd!';
const encryptedPassword = crypt.encryptPassword(userPassword);
// Store encryptedPassword in database

// Later, decrypt for verification
const decryptedPassword = crypt.decryptPassword(encryptedPassword);
console.log(decryptedPassword === userPassword); // true

Protecting Configuration Data

Encrypt sensitive configuration strings, such as API keys, in configuration files:

const ZetaCrypt = require('zetacrypt');
const crypt = new ZetaCrypt('configKey');

const apiKey = 'abc123xyz';
const encryptedApiKey = crypt.encryptPassword(apiKey);
// Save encryptedApiKey to config file

Supported Alphabet

ZetaCrypt uses the following character set for encryption and decryption:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()

Any character outside this set remains unchanged in the output.

Installation Notes

  • Ensure you have Node.js and npm installed.
  • The package has no external dependencies, making it compatible with most Node.js environments.
  • Tested with Node.js versions 14.x and above.

Issues

Report bugs or suggest improvements at github.com/64bitAtomic/ZetaCrypt/issues.