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

@sevladev/ciphers

v1.1.2

Published

A collection of ciphers.

Downloads

11

Readme

@sevladev/ciphers

A collection of ciphers.

  1. Caesar Cipher:
    • The Caesar Cipher is a simple substitution cipher named after Julius Caesar, who used it in his private correspondence. In this cipher, each letter in the plaintext is shifted a certain number of places down or up the alphabet. For example, with a shift of 3, ‘A’ would be replaced by ‘D’, ‘B’ would become ‘E’, and so on. The same process is applied in reverse for decoding, shifting each letter back by the same number of places. This straightforward encryption technique is one of the oldest and most well-known ciphers, though it is easily broken with modern methods.​⬤
  2. Vigenère Cipher:
    • The Vigenère Cipher is a more complex polyalphabetic substitution cipher invented by Blaise de Vigenère in the 16th century. It uses a keyword to determine the shift for each letter in the plaintext. Each letter of the keyword shifts the corresponding letter in the plaintext by its position in the alphabet. For example, with the keyword “KEY”, ‘A’ would be replaced by ‘K’, ‘B’ would become ‘F’ (shifted by ‘E’), and so on. The same process is applied in reverse for decoding, using the keyword to shift letters back to their original positions. This method provides greater security than simple substitution ciphers by varying the shifts across the plaintext, making frequency analysis more difficult.
  3. Atbash Cipher
    • The Atbash Cipher, an ancient encryption technique attributed to the Hebrew scholars of the Biblical era, is a classic substitution cipher where each letter of the alphabet is mapped to its reverse. This means that ‘A’ is substituted with ‘Z’, ‘B’ with ‘Y’, ‘C’ with ‘X’, and so on. It is a simple and symmetric cipher, meaning that the same algorithm is used for both encryption and decryption. The Atbash Cipher is one of the oldest known ciphers and is notable for its simplicity and historical significance.
  4. Alberti Cipher
    • The Alberti Cipher, invented by Leon Battista Alberti in the 15th century, is one of the earliest polyalphabetic ciphers. It uses two concentric disks to encrypt messages. The outer disk is fixed with a standard alphabet, while the inner disk is movable and can be rotated to create different substitution alphabets. By aligning the disks to a starting position and rotating the inner disk after a certain number of characters, the cipher provides a more secure encryption method than simple substitution ciphers. The same process is applied in reverse for decoding.
  5. Playfair Cipher
    • The Playfair Cipher, invented by Charles Wheatstone in 1854 and popularized by Lord Playfair, is a digraph substitution cipher that uses pairs of letters (digraphs) to encrypt messages. It employs a 5x5 grid of letters constructed using a secret keyword. Letters ‘I’ and ‘J’ are typically combined to fit the 25-letter grid. To encrypt, the plaintext is split into pairs of letters. If a pair contains the same letter or a single letter at the end, a filler letter like ‘X’ is added. Depending on the relative positions of the letters in the grid, each pair is substituted with another pair. The same grid and process are used in reverse for decryption. This method provides more security than simple substitution ciphers by encrypting letter pairs instead of individual letters.

Installation

To install the package, use:

npm install @sevladev/ciphers

Examples

Here is examples of how to use all ciphers in your application:

Caesar Cipher

import { caesarCipher } from "@sevladev/ciphers";

const str = "Hello, World!";
const salt = 3;

// Encode the text
const encodedText = caesarCipher(str, salt).encode();
console.log(`Encoded Text: ${encodedText}`); // Output: Khoor, Zruog!

// Decode the text
const decodedText = caesarCipher(encodedText, salt).decode();
console.log(`Decoded Text: ${decodedText}`); // Output: Hello, World!

Vigenère Cipher

import { vigenereCipher } from "@sevladev/ciphers";
const str = "Hello, World!";
const secret = "KEY";

// Encode the text
const encodedText = vigenereCipher(str, secret).encode();
console.log(`Encoded Text: ${encodedText}`); // Output: Rijvs Uyvjn!

// Decode the text
const decodedText = vigenereCipher(encodedText, secret).decode();
console.log(`Decoded Text: ${encodedText}`); // Output: Hello World!

Atbash Cipher

import { atbashCipher } from "@sevladev/ciphers";

const str = "Hello, World!";

const encodedText = atbashCipher(str).encode();
console.log(`Encoded Text: ${encodedText}`); // Output: Svool Dliow!

const decodedText = atbashCipher(encodedText).decode();
console.log(`Decoded Text: ${encodedText}`); // Output: Hello, World!

Alberti Cipher

import { albertiCipher } from "@sevladev/ciphers";

const str = "Hello, World!";
const initialPosition = 3;

const encodedText = albertiCipher(str, initialPosition).encode();
console.log(`Encoded Text: ${encodedText}`); // Output: Aufgl, Pmyld!

const decodedText = albertiCipher(encodedText).decode();
console.log(`Decoded Text: ${encodedText}`); // Output: Hello, World!

Playfair Cipher

import { playfairCipher } from "@sevladev/ciphers";

const str = "Hello, World!";
const initialPosition = "keyword";

const encodedText = playfairCipher(str, initialPosition).encode();
console.log(`Encoded Text: ${encodedText}`); // Output: GyiZsc, Okcfd!

const decodedText = playfairCipher(encodedText).decode();
console.log(`Decoded Text: ${encodedText}`); // Output: Hello, World!