A lightweight educational CLI for classical cryptography and encoding
Svelo helps you decode and encode text using classical ciphers and common encodings. Perfect for CTF challenges, learning cryptography, or exploring historical cipher techniques.
This project aims to be more than just a decoder tool—it's growing into a comprehensive educational resource for cryptography. We're building:
- Learning-focused features: Explanations, tutorials, and cipher background
- Interactive exploration: Hands-on cipher experimentation
- Community-driven growth: Open to contributions and ideas
See our ROADMAP.md for planned features like an in-app glossary, cryptanalysis tools, and educational tutorials.
python -m venv .venv
. .venv/bin/activate
pip install -e .Just run svelo to launch the interactive menu:
sveloThis gives you a guided experience with:
- Decode - Try all decoders automatically on your input
- Decrypt - Use keyed ciphers (Vigenère, Playfair, etc.) with retry
- Encode - Convert plaintext to encodings
- Encrypt - Use keyed ciphers to encrypt
- Learn - Browse the cipher glossary with 33 detailed entries
- Help - Reference guide for all features
The interactive mode handles special characters safely and guides you through each step.
For quick decodes, pass the encoded text directly:
svelo "SGVsbG8gV29ybGQh"
# Auto-tries all decoders and shows ranked resultsRead from stdin:
echo "48656c6c6f" | sveloView detailed information about any cipher:
svelo --info vigenere
svelo --info caesar
svelo --info playfairEach entry includes how it works, historical context, security level, and learning resources.
Encode text interactively:
svelo --encode "Hello World"
# Prompts you to choose an encoderOr specify the encoder directly:
svelo --encode --encoder hex "Hello World"
# Output: 48656c6c6f20576f726c64List available decoders/encoders:
svelo --list
svelo --list-encodersTry multiple decode layers (chained decoding):
svelo --chain-depth 2 "H4sIAAAAA..."Show only top results:
svelo --top 5 "encoded_text"Rank by improvement vs input:
svelo --rank delta --top 3 "Gur pbpx pebjf ng qnja."For a complete list of options, see the Options section below.
The interactive menu provides guided workflows:
- Decode: non-keyed decoders (formats and simple transforms)
- Decrypt: keyed ciphers (you supply keys and can retry)
- Encode: non-keyed encoders
- Encrypt: keyed ciphers (you supply keys)
- Learn: cipher glossary with descriptions, history, and references
In Decrypt mode, you select a keyed cipher and keep trying keys until you copy a successful result or return to the menu. In Learn mode, browse or search ciphers to understand how they work and their historical context.
- hex, binary, base64, base64url, base32, base85, ascii85, base58, url
- rot13, caesar, fibonacci, atbash, reverse, bacon, polybius, morse, railfence, scytale, xor
- vigenere, beaufort, variant, autokey, keyword, columnar, playfair, hill, adfgx, adfgvx (interactive encrypt/decrypt)
- gzip, zlib, jwt
--listlist available decoders--list-encoderslist available encoders--info CIPHERshow glossary entry for a cipher--encodeencode input (prompts for cipher)--interactivelaunch interactive menu--pasteread input from stdin (safe for quotes/backticks)--encoderencoder to use in encode mode (skips prompt)--decoderrun specific decoders only (repeatable)--chain-depthnumber of decode passes to attempt--min-scorefilter low-confidence results by absolute score (0-1)--min-deltafilter outputs that do not improve vs input--topshow only the top N ranked results--rankranking mode: absolute, delta, or both--max-per-decodercap results per decoder family (0 = no cap)--allshow all results (ignore filters and top)--max-resultsstop after N results--show-hexinclude hex output--max-charstruncate long outputs (0 = no limit)--colorcolor output: auto, always, or never--railfence-strip-spacesstrip spaces before rail fence encoding--keykey for keyed ciphers in encrypt mode (non-interactive)--key2second key for ADFGX/ADFGVX in encrypt mode (non-interactive)
Note: Most users will prefer the interactive menu (svelo with no arguments) which handles all of these options with guided prompts. The command-line flags above are for scripting and advanced use cases.
Keyed ciphers (vigenere, beaufort, variant, autokey, keyword, columnar, playfair, hill, adfgx, adfgvx)
are available in the interactive encrypt/decrypt flows, where you can supply keys and retry.
In non-interactive encrypt mode, provide --key (and --key2 for ADFGX/ADFGVX).
To make results reproducible across tools, svelo uses explicit conventions:
- vigenere/beaufort/variant/autokey: key is letters A-Z only; key advances on letters; non-letters are preserved; case is preserved.
- keyword substitution: key is letters A-Z only; non-letters preserved; case preserved.
- columnar transposition: key is letters A-Z only; all characters (including spaces) are transposed.
- playfair: letters only with J->I; output is uppercase letters, no spacing or punctuation; uses X as filler.
- hill (2x2): key is exactly 4 letters; text uses letters only; pads with X.
- adfgx: letters only with J->I; uses ADFGX digraphs, then columnar transposition.
- adfgvx: letters/digits only; uses ADFGVX digraphs, then columnar transposition.
Rail fence output can depend on whether spaces are kept as characters or stripped first.
This tool supports both and labels decode results accordingly (e.g. rails=3,stripspaces=yes).
This tool avoids external dependencies by using the Python standard library only.
This project is for educational and informational purposes only and is provided "as is" without warranty. Do not rely on it for security-critical or irreversible data without independent verification.
Run the test suite:
pip install -e ".[dev]"
pytestTest Coverage:
The project includes comprehensive tests for core cryptographic functionality:
- ✅ All cipher algorithms - Thoroughly tested with roundtrip tests and known outputs
- ✅ All encoders/decoders - Verified against standard implementations
- ✅ Basic CLI flags -
--list,--encode,--decoder,--info, stdin input - ✅ Glossary system - Verified
--infoflag returns correct entries
Not Currently Tested:
- Interactive menu workflows (manually tested)
- Some advanced CLI flags (
--chain-depth,--min-score,--rank, etc.) - Learn menu browse/search functionality (manually tested)
The cryptographic implementations are the most critical components and are thoroughly tested. Interactive features have been manually verified to work correctly.
Contributions are welcome! We're especially interested in:
- New ciphers and encodings: Add support for additional cryptographic techniques
- Educational content: Glossary entries, explanations, historical context
- Analysis features: Frequency analysis, cipher detection, cryptanalysis tools
- Documentation: Tutorials, examples, and learning resources
- Bug fixes and improvements: Better accuracy, performance, or UX
See CONTRIBUTING.md for guidelines and ROADMAP.md for planned features.
Quick Start for Contributors:
- Fork the repository
- Create a feature branch
- Make your changes (add tests!)
- Open a pull request
We're actively expanding Svelo into a comprehensive cryptography education tool. Planned features include:
- Glossary system: In-app explanations with reference links for each cipher
- Cryptanalysis tools: Frequency analysis, pattern detection, cipher identification
- Tutorial mode: Interactive lessons on how ciphers work
- Historical context: Background on when/where ciphers were used
- Additional ciphers: Four-square, bifid, trifid, and more
See the full ROADMAP.md for details and status.
- Bug reports: Open an issue
- Feature requests: Share your ideas in Issues
- Questions: Start a discussion or open an issue
- Educational ideas: We'd love to hear about cipher resources or teaching opportunities
MIT License - see LICENSE for details.