Ciphey in Rust: an A* search over 24 decoders that peels encodings and classical ciphers without a key
⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡
At a glance
- What is it?
- Ciphey takes a string, searches chains of decoders until something looks like plaintext, and names what it found. The Rust rewrite at v0.12.1 is fast and scriptable, but it stops at the first plausible answer, gives up after five seconds by default, and its decoder table covers encodings and classical ciphers rather than hashes or modern encryption.
- Who is it for?
- Ciphey is the right tool when you have a blob from a CTF challenge, a log or a config file that has been Base64'd, hexed or ROT13'd one or more times and you want the plaintext without guessing the order. It is the wrong tool for hashes or modern encryption, since its 24-entry decoder table holds encodings and classical ciphers only.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 20 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- bee-san/Ciphey21,799 ★ · +137
| Repository | 2026-10-07 | 2026-11-26 |
|---|---|---|
| bee-san/Ciphey | 21.7k | 21.8k |
137 Stars in the last 50 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
An A* search over chains of decoders instead of a cipher picker
Ciphey never asks what kind of input you gave it. It treats decoding as a search problem: an A* search tries the most promising chains of decoders first, so Base64 inside hex inside ROT13, or four layers of Base64, are found by exploring combinations rather than by you naming them. Each decoder runs in parallel through Rayon on up to 10 candidate texts at a time. The search stops at the first candidate that looks like plaintext. By default Ciphey shows that candidate and asks you to confirm with y/N before accepting it, and if nothing has turned up after 5 seconds it stops and tells you so. Both behaviours are flags:
ciphey -t 'NTA3NjYzNzU3MjZjMjA3NjY2MjA2OTcyNjU2YzIwNzM2ZTY2Njc=' # ROT13 → hex → Base64, nothing else needed
ciphey -f secret.txt # read the input from a file
ciphey -d -t '...' # no y/N prompt: take the first plaintext found (handy in scripts)
ciphey -c 15 -t '...' # keep searching for up to 15 seconds (the default is 5)
ciphey -r 'flag\{' -t '...' # only accept plaintext that matches a regex (a crib)
ciphey --wordlist words.txt -t '...' # also accept any exact match from a wordlistThe full option list comes from ciphey --help.
Twenty-four decoders, and none of them is a hash cracker
The repository tagline promises to crack hashes, but the decoder table in the current README tells a narrower story. It lists 24 decoders and crackers in four groups. Base encodings: Base64 in standard and URL-safe form, Base32, Base58 in its Bitcoin, Flickr, Monero and Ripple alphabets, Base91, Base65536 and Z85. Other encodings: hexadecimal, binary, URL percent-encoding, Morse code, Braille, A1Z26 and Citrix CTX1. Ciphers: Caesar including ROT13, ROT47, Atbash, Vigenère with the key worked out automatically, rail fence and reversed text. Oddities: Brainfuck, which Ciphey executes, and Morse or binary written with substitute symbols. Hash cracking does not appear in that table, and neither does any modern block or stream cipher. If your input is a password hash or something encrypted with a real key, Ciphey has no decoder for it and will run until the timer expires. Issue #1030 tracks 109 further decoders that have not landed yet.
Accepting the first plausible plaintext can accept the wrong one
Because the search halts at the first candidate that looks like plaintext, the answer you get is the first convincing one, not a ranked list. Interactively that is manageable: the y/N prompt lets you reject a bad guess. In a script, the -d flag removes the prompt and takes whatever comes first, which is convenient and also the point where a misread can slip into your pipeline unnoticed. The project gives you two levers to tighten acceptance. A regular expression passed with -r acts as a crib, so only output matching something like flag{ counts; a file passed with --wordlist adds exact-match acceptance. For CTF work where the flag format is known, a crib is the safer default. The 5 second timer is the other trap. Deep or slow chains can run out the clock, and the result is a plain failure message rather than a partial answer, so raise the limit with -c when a run gives up.
LemmeKnow names the result but ignores shape-only patterns
Every candidate plaintext also passes through LemmeKnow, the Rust port of pyWhat, which recognises more than 120 formats. That is why Ciphey reports what it found and not just the decoded bytes: a password inside a mount or sshpass command, a TOTP secret, a GitHub token or Stripe key, an IP or MAC address, an email address or URL, a crypto wallet, an AWS ARN, JSON, or a CTF flag in formats such as flag{...}, picoCTF{...} or DUCTF{...}.
$ ciphey -t '3139322e3136382e302e31'
🕵️ I think the plaintext is Internet Protocol (IP) Address Version 4.
Possible plaintext: '192.168.0.1' (y/N):There is a deliberate gap. LemmeKnow patterns that only check which characters a string contains and how long it is are switched off, because decoder junk matches them constantly. Card numbers and phone numbers fall in that category. If the hidden value is one of those, Ciphey can still decode it, but it will not label it, and recognition will not help the search settle on it.
The first run writes a config file and a result cache under ~/.ciphey
The first time you launch Ciphey it runs a short setup that asks for a colour theme, how results should be displayed and whether to use a wordlist, then saves the answers to ~/.ciphey/config.toml. That prompt matters if you drop Ciphey into a container or a CI job, since a fresh home directory means the setup runs again. Ciphey also caches answers in ~/.ciphey/database.sqlite, so feeding it the same input a second time returns in milliseconds. That is helpful during a CTF when you revisit a string, and it is also a reason to read published timings carefully: the project's own benchmark gave each run a fresh $HOME specifically so the cache could not help. Anyone comparing Ciphey against another decoder on their own machine should do the same, or the second run will look far faster than the search itself is.
The speed claims come from a recorded benchmark against Python Ciphey 5.14
This Rust codebase replaces the older Python Ciphey, whose last tagged release was 5.14.0 in June 2021. The README publishes a comparison measured as the wall-clock median of 10 runs per input (3 for Python Ciphey) on a shared 16-CPU Linux machine, with the y/N prompt off and every run capped at 60 seconds. Base64 alone took 0.11 s against 0.92 s. Hex then Base64 took 0.14 s against 1.02 s. ROT13, hex and Base64 together took 0.19 s, while the Python version gave no answer within 60 seconds; the same happened with ROT13, hex, Base64 and Base32, which Rust Ciphey finished in 1.15 s. On hex, Base32, Base64 and hex, Python Ciphey returned a wrong answer. Where both produced the right plaintext, the Rust version was 1.9 to 8.6 times faster. The script and raw numbers live under media/tui-video/bench on the media/readme-videos branch, so the figures can be rerun rather than taken on trust.
Crates.io, prebuilt binaries, source, Docker or a Discord bot
The shortest route is through Cargo:
cargo install cipheyThat compiles from crates.io and needs a Rust toolchain. Prebuilt binaries skip the compile and come with a .sha256 checksum each, but only for Linux on x86_64, macOS on Intel and Apple silicon, and Windows on x86_64; ARM Linux users are left with Cargo, source or Docker. Building from source is the clone-and-build path:
git clone https://github.com/bee-san/Ciphey
cd Ciphey
cargo build --release # the binary is target/release/cipheyThe Dockerfile builds in a rust:alpine stage, installing build-base, pkgconfig and openssl-dev, then copies the binary into an alpine:3.12 image with ciphey as the entrypoint. The justfile's publish recipe pushes autumnskerritt/ciphey:latest for linux/arm/v7, linux/amd64 and linux/arm64/v8. For no install at all, the Discord server's #bots channel answers $ciphey followed by your text.
A library crate and an MCP server that stays out of the default build
Ciphey is also a Rust library. Cargo.toml defines a lib target at src/lib.rs next to the ciphey binary at src/main.rs, documentation is published on docs.rs, and examples/decode.rs shows library use. A second binary, ciphey-mcp, exposes Ciphey as a Model Context Protocol stdio server for AI assistants. It is gated behind the mcp feature, and the default feature list is empty, so a plain cargo install ciphey does not produce it. The reason is stated in Cargo.toml: keeping the feature off spares the CLI and the library from pulling in the MCP SDK and an async runtime. The mcp feature brings in rmcp, tokio and memory-stats, and rmcp is pinned to exactly 3.5.1 because cargo install ignores Cargo.lock. The crate version, 0.12.1, matches the latest release tag from August 31, 2026, and the repository's last push was on November 1, 2026.
Editorial conclusion
Ciphey is the right tool when you have a blob from a CTF challenge, a log or a config file that has been Base64'd, hexed or ROT13'd one or more times and you want the plaintext without guessing the order. It is the wrong tool for hashes or modern encryption, since its 24-entry decoder table holds encodings and classical ciphers only. Before trusting it in a script with -d, decide on a crib or wordlist, because the default is to accept the first candidate that looks like plaintext.
Frequently asked questions
How do I install Ciphey?
Run cargo install ciphey, download a prebuilt binary for Linux x86_64, macOS or Windows x86_64 from the releases page, or clone the repository and run cargo build --release. You can also skip installing and use $ciphey in the #bots channel of the Discord server.
How do I use Ciphey?
Pass the text with -t, or a file with -f, for example ciphey -t 'aGVsbG8gdGhlcmUgZ2VuZXJhbA=='. Ciphey shows the first plausible plaintext and asks y/N; -d skips that prompt and -c changes the 5 second search limit.
How can I decode a cipher with Ciphey without knowing which cipher it is?
Give Ciphey the ciphertext and it searches chains of its 24 decoders on its own, including Caesar, ROT47, Atbash, Vigenère and rail fence. Adding a regex crib with -r restricts which plaintext it accepts.
Is it possible to crack encryption with Ciphey?
Only for the classical ciphers in its table, such as Caesar, Vigenère, Atbash and rail fence, where it works out the key itself. Its decoder table lists no modern encryption and no hash crackers.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/bee-san-ciphey)Star history chart for your README
[](https://hysenlabs.com/projects/bee-san-ciphey)Was this useful?