Skip to content
zytherdevPublic

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCode

Hand-coding tools for classic ciphers — as an app, an API, and a library.

Encode and decode messages with Enigma, Morse, Polybius, Vigenère, Bacon, and more. Built for cryptography enthusiasts, learners, and developers who want to embed ciphers into their own projects.

License: MIT PRs Welcome npm

Web app · API · Docs · npm


What is SCode

SCode is a monorepo with four pieces that share one core:

Piece What it is Who it's for
web/ A React app for encoding/decoding in the browser. Anyone curious about ciphers.
npm/ @zyther/scode-core — the cipher engine as a TypeScript library. Developers embedding ciphers in JS/TS projects.
api/ A Next.js HTTP API wrapping the core. Apps in any language that need ciphers over HTTP.
cli/ @zyther/scode-cli — the scd command-line tool. Terminal users, shell scripts, CI pipelines.

Every cipher runs entirely client-side in the web app, and statelessly in the API. No accounts, no tracking, no data stored between requests.

Try it

Encode via API

curl -X POST https://api.scode.zyther.dev/api/encode \
  -H "Content-Type: application/json" \
  -d '{"message": "hello world", "pattern": "¬"}'

Encode via library

import { encode, decode, format_str } from "@zyther/scode-core"

const { encrypted, config, pattern } = encode({
  message: format_str("hello world"),
  pattern: "¬",       // Morse
})

const { message } = decode({ encrypted, pattern, config })
// → "HELLOWORLD"

Encode via CLI

scd encode "hello world" --pattern "¬"
# → -.-. .... . .-.. .-.. ---

The pattern system

What makes SCode different from "just another cipher library": ciphers compose.

A pattern is a string of cipher symbols applied in sequence. Chain them to layer encryption:

encode({ message: "meet me at dawn", pattern: "?|" })
//                                             ││
//                              Enigma ────────┘│
//                              Vigenère ───────┘

Patterns are applied right-to-left (last symbol = innermost encoding), so decoding reverses the order automatically. The response includes a config string with whatever parameters are needed to decode — pass it back verbatim.

Symbol Cipher Symbol Cipher
$ SCSimply (key) | Vigenère
¢ SCSimply (key_m) § Frama
@ SCSimply (a_num) ₢ Bacon
¬ Morse & Mutation — reciprocity
£ Binary ~ Mutation — decalation
# Polybius : Order — reverse
* Navajo ° Order — random
? Enigma

Symbols @, *, # are restricted — they only work at the end of a pattern.

Repository structure

scode/
├── web/          React app (Vite + Tailwind)
├── npm/          @zyther/scode-core — the cipher engine
├── api/          Next.js HTTP wrapper around the core
├── cli/          @zyther/scode-cli — the `scd` command
└── ...

The core is the source of truth for every cipher. The web app and the API both consume it — no duplicated logic.

Tech stack

Web Core API CLI
Framework React 18 + Vite TypeScript Next.js 15 commander
Styling Tailwind — Tailwind picocolors
Validation — — Zod —
Build Vite tsup Next tsup
Docs — — Scalar (OpenAPI) --help

Contributing

Contributions are welcome — new ciphers, docs, bug reports, anything.

  1. Fork the repo
  2. Create a branch (git checkout -b feat/my-cipher)
  3. Commit your changes (git commit -m 'feat: add X cipher')
  4. Push (git push origin feat/my-cipher)
  5. Open a Pull Request

Please follow Conventional Commits.

License

MIT © Zyther Dev


Built with ♥ for cryptography.

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages