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

vic-cipher

v2026.3.1

Published

VIC cipher utility with shared TypeScript core for Node and Deno

Downloads

90

Readme

vic-cipher

TypeScript VIC-cipher library and CLI for Node.js, with Deno compatibility.

Security Notice

VIC is a historical cipher and is not secure for modern cryptographic use. Use this project for historical research, education, and interoperability testing.

Highlights

  • Shared TypeScript core for encode/decode and intermediate-key derivation
  • Node CLI (vic encode, vic decode)
  • Deno-compatible CLI and npm package usage
  • JSON output mode for automation
  • Stdin pipeline mode (- placeholders)
  • Optional strict mode to reject lossy normalization
  • Public documentation vectors (CIA/Wikipedia mechanics)

Install

CLI

npm install -g vic-cipher

Library

npm install vic-cipher

CLI Usage (Node)

Encode

vic encode \
  --song "When I find myself in times of trouble mother mary comes to me" \
  --mi 12345 \
  --date 1752-09-03 \
  --personal-id 7 \
  --message "Meet at 9. Bring map."

Decode

vic decode \
  --song "When I find myself in times of trouble mother mary comes to me" \
  --date 1752-09-03 \
  --personal-id 7 \
  --code "60377 31953 34771 79034 11234 57102 6"

JSON Mode

vic encode ... --json

Outputs:

{"ok":true,"mode":"encode","result":"..."}

Strict Mode

vic encode ... --strict
vic decode ... --strict
  • Encode strict mode rejects message input if normalization would drop characters.
  • Decode strict mode rejects non-digit noise (whitespace formatting is allowed).

Stdin Pipeline Mode

Use - to read exactly one argument value from stdin:

echo "HELLO123" | vic encode \
  --song "When I find myself in times of trouble mother mary comes to me" \
  --mi 12345 \
  --date 1752-09-03 \
  --personal-id 7 \
  --message -

Library API

import { encodeVic, decodeVic, deriveIntermediateKeys } from "vic-cipher";

const encoded = encodeVic({
  song: "When I find myself in times of trouble mother mary comes to me",
  mi: "12345",
  date: new Date("1752-09-03"),
  personalId: 7,
  message: "Meet at 9. Bring map.",
  strict: false,
});

const decoded = decodeVic({
  song: "When I find myself in times of trouble mother mary comes to me",
  date: new Date("1752-09-03"),
  personalId: 7,
  code: encoded,
  strict: false,
});

const keys = deriveIntermediateKeys(
  "When I find myself in times of trouble mother mary comes to me",
  "12345",
  new Date("1752-09-03"),
  7,
);

Input Rules

  • song: at least 20 alphanumeric chars after normalization
  • mi: exactly 5 digits (encode)
  • date: valid JavaScript Date
  • personalId: integer 0..16
  • message: normalized to A-Z, 0-9, .
  • code: decode strips non-digits unless strict mode rejects invalid noise

Deno Usage

Import from npm in Deno

import { encodeVic } from "npm:vic-cipher";

Run CLI through npm package in Deno

deno run -A npm:vic-cipher encode \
  --song "When I find myself in times of trouble mother mary comes to me" \
  --mi 12345 \
  --date 1752-09-03 \
  --personal-id 7 \
  --message HELLO123

Native Deno entrypoint (repo usage)

deno task vic encode --song "..." --mi 12345 --date 1752-09-03 --personal-id 7 --message "..."

Development

Setup

npm install

Build

npm run build

Test

npm test

Testing Strategy

  • Stage tests for arithmetic and transposition primitives
  • End-to-end encode/decode round-trip tests
  • Public documented-rule vectors:
    • chain addition
    • sequentialization
    • mod-10 subtraction without borrowing
    • worked key-schedule values

Fixtures live in test-vectors/.

Release and Versioning (CalVer)

This project uses CalVer: YYYY.M.PATCH (UTC). Examples:

  • 2026.3.0
  • 2026.3.1
  • 2026.4.0

Bump version

npm run calver:bump
  • Same year/month: increments patch
  • New month: resets patch to 0

npm Publish Checklist

  1. npm install
  2. npm test
  3. npm pack (inspect package contents)
  4. npm publish --access public

CI

GitHub Actions workflow runs:

  • Node matrix tests (Node 20 and 22)
  • Deno type check and CLI smoke run

Sources

  • CIA: Number One From Moscow: https://www.cia.gov/resources/csi/static/Number-One-From-Moscow.pdf
  • Wikipedia VIC cipher: https://en.wikipedia.org/wiki/VIC_cipher