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

cipherwave

v1.0.0

Published

Varying Caesar cipher encryption with secret-based shifting and salting

Downloads

7

Readme

Cipherwave

Cipherwave is a lightweight, secret-based encryption library that extends the Caesar Cipher concept. It uses a varying shift pattern derived from a secret key, shuffles the character set, adds salting, and applies multiple encryption passes for stronger obfuscation.

Cipherwave is ideal for lightweight encryption needs like token generation, secure ID masking, license keys, and obscured messaging where full cryptographic encryption (AES, RSA) would be too heavy.


Features

  • Varying Caesar Cipher: Each character is shifted based on the corresponding character in the secret.
  • Shuffled Character Set: The character list is shuffled deterministically based on the secret, making patterns harder to detect.
  • Salting: A random salt is prepended to the message before encryption, ensuring different outputs even for the same input.
  • Multiple Encryption Passes: The encryption is applied twice to enhance complexity.
  • Secret Enforcement: Requires a minimum 16-character secret for security.
  • Simple API: Initialize once, then easily encode and decode messages.

Installation

Install Cipherwave using npm:

npm install cipherwave

Basic Usage

Importing

import { initialize, encode, decode } from "cipherwave";

Initialization

Before using encode or decode, initialize the library with your secret and optional salt length:

initialize({
  secret: process.env.CIPHERWAVE_SECRET!,
  saltLength: 8 // Optional, defaults to 8
});

Important: The secret must be at least 16 characters long. Shorter secrets will cause an error.

Encoding

const encrypted = encode("This is a secret message!");
console.log(encrypted); // Encrypted string

Decoding

const decrypted = decode(encrypted);
console.log(decrypted); // "This is a secret message!"

API Reference

initialize(options: { secret: string; saltLength?: number }): void

Initialize Cipherwave with encryption settings.

  • secret (string) - The secret key used for varying shifts and shuffling (minimum 16 characters).
  • saltLength (`number) - Optional. The length of the random salt to prepend (default is 8).

encode(message: string): string Encrypt a message using the initialized secret and salt settings.

  • message (string) - The plaintext message to encrypt.
  • Returns: Encrypted string.

decode(encodedMessage: string): string Decrypt a previously encoded message.

  • encodedMessage (string) - The encrypted message to decrypt.
  • Returns: Original plaintext message.

How It Works

  1. Character Set Shuffling A full set of allowed characters (letters, numbers, symbols) is shuffled based on the secret using a deterministic pseudo-random process. Every secret produces a unique shuffle.

  2. Varying Shifts Each character of the input message is shifted by an amount based on the corresponding character of the secret (looping over the secret if necessary). This results in a dynamic, non-linear shift pattern.

  3. Salting A random string (salt) of specified length is prepended to the input before encoding. This makes encryptions of the same message produce different results.

  4. Multiple Encryption Passes Cipherwave applies the encryption process twice to increase the complexity and further obscure any patterns.

Full Example

import { initialize, encode, decode } from "cipherwave";

// Step 1: Initialize
initialize({
  secret: "ThisIsASecretKey1234",
  saltLength: 12
});

// Step 2: Encrypt
const plaintext = "Sensitive Data!";
const encrypted = encode(plaintext);
console.log("Encrypted:", encrypted);

// Step 3: Decrypt
const decrypted = decode(encrypted);
console.log("Decrypted:", decrypted); // Output: "Sensitive Data!"

Security Considerations

Cipherwave provides lightweight encryption and strong obfuscation against casual inspection and basic attacks. However, it is not intended for highly sensitive information (e.g., passwords, credit cards, legal documents).

For high-security encryption, use modern cryptographic algorithms such as AES-256 or RSA-4096.

Cipherwave is ideal for:

  • ID obfuscation
  • License key generation
  • URL-safe token generation
  • Lightweight message protection

Final Notes

Cipherwave brings modern improvements to the classical Caesar cipher concept through secret-driven variable shifts, character set randomization, salting, and multiple passes. It offers strong obfuscation capabilities with a lightweight footprint.

Enjoy encrypting with Cipherwave! 🔥