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

cipher-utils

v1.0.2

Published

A package for common cipher utilities like ROT13, Base64, XOR

Readme

cipher-utils - Pure JavaScript Cipher Implementation

Ever wondered how ciphers really work under the hood? cipher-utils lets you explore three classic encryption algorithms - ROT13, Base64, and XOR cipher - implemented purely in JavaScript, with zero dependencies and no complex regex patterns.

Installation

npm install cipher-utils

Getting Started

Import specific functions or grab the entire package:

// Pick what you need
import { rot13, encode, decode, encrypt, decrypt } from 'cipher-utils';

// Or import everything
import CipherUtils from 'cipher-utils';
const { rot13, encode, decode, encrypt, decrypt } = CipherUtils;

ROT13 - The Simple Letter Shifter

ROT13 shifts each letter 13 positions in the alphabet. Run it twice and you're back to square one!

import { rot13 } from 'cipher-utils';

const text = 'Hello, World!';
console.log(rot13(text)); // Output: Uryyb, Jbeyq!
console.log(rot13('Uryyb, Jbeyq!')); // Back to: Hello, World!

Base64 - Built from Scratch

No Buffer magic here! Just pure JavaScript implementation of Base64 encoding:

import { encode, decode } from 'cipher-utils';

const text = 'Hello, World!';
console.log(encode(text)); // Output: SGVsbG8sIFdvcmxkIQ==
console.log(decode('SGVsbG8sIFdvcmxkIQ==')); // Back to: Hello, World!

// Short strings get padding:
console.log(encode('Test')); // Output: VGVzdA==

XOR Cipher - Simple Symmetric Encryption

Perfect for casual obfuscation (not Fort Knox level security!). Use the same key to encrypt and decrypt:

import { encrypt, decrypt } from 'cipher-utils';

const message = 'Secret message';
const key = 'my_secret_key';

const encrypted = encrypt(message, key);
console.log(encrypted); // Hex string

const decrypted = decrypt(encrypted, key);
console.log(decrypted); // Back to: Secret message

API Reference

  • rot13(inputString) → Returns ROT13 transformed string
  • encode(inputString) → Returns Base64 encoded string
  • decode(base64String) → Returns decoded string
  • encrypt(inputString, key) → Returns hex-encoded encrypted string
  • decrypt(hexInput, key) → Returns decrypted string

Why Use cipher-utils?

  • Zero dependencies keeps your project lean
  • No regex complexity to deal with
  • Pure JavaScript implementation you can easily understand
  • Great for learning how ciphers actually work
  • Perfect for educational projects or simple encryption needs

Contributing

Fork the repository. Create a feature branchAdd tests for your changes. Submit a pull request.

License

MIT Licensed - feel free to use and modify as needed.