Ciphey README

The project's README from github.com/bee-san/Ciphey. As one markdown file: README.md.



➡️ Discord | Documentation ⬅️

Project ciphey

ciphey demo

ciphey is the next generation of decoding tools, built by the same people that brought you Ciphey.

We fully intend to replace Ciphey with ciphey.

✨ You can read more about ciphey here https://skerritt.blog/introducing-ciphey/ ✨

How to Use

The simplest way to use ciphey is to join the Discord Server, head to the #bots channel and use ciphey with $ciphey. Type $help for helpful information!

The second best way is to use cargo install ciphey and call it with ciphey.

You can also git clone this repo and run docker build . it to get an image.

Features

Some features that may interest you, and that we're proud of.

Fast

ciphey is fast. Very fast. Other decoders such as Ciphey require advance artifical intelligence to determine which path it should take to decode (whether to try Caesar next or Base64 etc).

ciphey is so fast we don't need to worry about this currently. For every 1 decode Ciphey can do, ciphey can do ~7. That's a 700% increase in speed.

Library First

There are 2 main parts to ciphey, the library and the CLI. The CLI simply uses the library which means you can build on-top of ciphey. Some features we've built are:

Decoders

ciphey currently supports 16 decoders and it is growing fast. Ciphey supports around ~50, and we are adding more everyday.

Timer

One of the big issues with Ciphey is that it could run forever. If it couldn't decode your text, you'd never know!

ciphey has a timer (built into the library and the CLI) which means it will eventually expire. The CLI defaults to 5 seconds, the Discord Bot defaults to 10 (to account for network messages being sent across).

Better Docs, Better Tests

ciphey already has ~120 tests, documentation tests (to ensure our docs are kept up to date) and we enforce documentation on all of our major components. This is beautiful.

LemmeKnow

Screenshot 2022-12-18 at 17 08 36

LemmeKnow is the Rust version of PyWhat. It's 33 times faster which means we can now decode and determine whether something is an IP address or whatnot 3300% faster than in Python.

Multithreading

Ciphey did not support multi-threading, it was quite slow. ciphey supports it natively using Rayon, one of the fastest multi-threading libraries out there.

While we do not entirely see the effects of it with only 16 decoders (and them being quite fast), as we add more decoders (and slower ones) we'll see it won't affect the overall programs speed as much.

Multi level decodings

Ciphey did not support multi-level decryptions like a path of Rot13 -> Base64 -> Rot13 because it was so slow. ciphey is fast enough to support this, although we plan to turn it off eventually.

Configurable Sensitivity for Plaintext Detection

ciphey now supports configurable sensitivity levels for gibberish detection, allowing for more accurate plaintext identification across different types of encodings. Classical ciphers like Caesar use Low sensitivity to better handle English-like results, while most other decoders use Medium sensitivity by default.

This feature helps reduce false positives and negatives in plaintext detection, making ciphey more reliable across a wider range of encoded texts.

Enhanced Plaintext Detection with BERT

ciphey now offers enhanced plaintext detection using a BERT-based model from the gibberish-or-not crate. This feature:

New Features

Better search algorithm

We now use A* search. This is very fast.

A* works by using a heuristic to estimate the cost of reaching the goal from the current state.

First, we ignore the heuristic for very fast decoders like Base64 and ensure we run them first each time on each node.

Then, we calculate the heuristic for the remaining decoders using cipher_identifier which can determine the probability a given string is a certain cipher.

We store previous results in a cache to avoid recalculating the same path.

We prune the search tree to avoid unnecessary calculations and keep the memory usage down if it gets too bad.

We also keep track of statistics on decoders to dynamically prioritise decoders that work better (example: caesar is popular, but Beaufort is not so Caesar will dynamically be prioritised over Beaufort)

Finally, we keep track of popular pairs. So base64 -> base64 is very popular, so we prioritise that path (among others).

Custom themes

You can now set a custom theme for ciphey. This is useful if you want to make ciphey look different.

This also helps with accessibility.

Vigenere

We now use perhaps the best algorithm for Vigenere.

It's fast, accurate and handles non-letter characters better than any other algorithm.

Better English checking

We use a qudgaram / trigram / english dict checker to calculate probability of plaintext.

We change the thresholds depending on the cipher. Example is that Caesar returns text that "looks" like english, whereas base64 does not.

As well as this, we have a database of popular regex (about 500) of api keys, mac addresses, etc.

We also have a is_password function to determine if a string is an exact password seen in a data dump.

More ciphers

Database

We now store statistics in a database. This is useful for seeing how ciphey is doing over time.

AI Use

We use AI for 2 things:

  1. The TUI is entirely vibe coded.
  2. I made AI spend hours researching every single CTF challenge out there. It created a list of 15,071 CTFs. It then went through every single CTF and looked for writeups. In those writeups it looked for anything related to encoding / decoding. It then created tests out of those. This enabled us to increase our testing coverage and make sure all CTF encoding / decoding challenges are solveable with this tool.

Ciphey (bee-san/Ciphey)

Searching Database…

21.7K ·GitHub
这是什么?ciphey 可以在不知道密钥或加密算法的情况下自动解密密文,还能解码各种编码格式、破解哈希。它是用 Rust 重写的 Ciphey 新一代版本——每次解码大约快 7 倍——同一团队打算用它完全取代原版。
它是命令行工具,还是我能拿来二次开发的库?两者都是,这是刻意设计的:库是核心,命令行只是它的一个使用者,所以你可以在它之上开发自己的工具——Discord 机器人就是这么做的。
我怎么把它跑起来?零安装:加入 Discord 服务器,在 #bots 频道里调用 $ciphey 即可。否则可以运行 cargo install ciphey 然后使用 ciphey 命令,或者 git clone 仓库后用 docker build . 构建镜像。
AI 功能需要 Hugging Face 账号或 API 密钥吗?只有可选的基于 BERT 的明文检测才需要,它能把准确率提高大约 40%:需要一个免费的 Hugging Face 账号和一次性的 500MB 模型下载,通过 ciphey --enable-enhanced-detection 开启。
如果它破解不了我的输入,会怎么样?它会放弃,而不是无限运行:每次尝试都有时间限制,命令行默认 5 秒,Discord 机器人是 10 秒,所以你能很快知道它失败了。
它现在支持哪些密码和编码?目前有 16 个解码器,而旧版 Ciphey 大约 50 个,而且新的解码器几乎每天都会上线。最近新增的有 Braille、Atbash 和一个强大的 Vigenere 实现,Base64 接 Rot13 这样的链式解码也能做到。
它是怎么决定先试哪个解码器的?用的是 A* 搜索:像 Base64 这种非常快的解码器总是先运行,然后由一个密码分类器按概率给剩下的候选打分。结果会缓存,搜索树会被剪枝,解码器还会根据成功统计重新排优先级。
它能发现解码结果里的密码或 API 密钥吗?能——它内置了一个大约 500 条正则表达式的数据库,可以匹配 API 密钥、MAC 地址之类的内容,还有一个 ispassword 检查,能标记出与已知数据泄露库中密码完全一致的字符串。
我能有多大的把握它在 CTF 题目上真的好用?作者让 AI 爬取了 15,071 道 CTF 题目及其题解中所有与编码相关的内容,然后把它们变成了测试——那套约 120 个测试的测试集,就是为了证明每一道真实的 CTF 编码解码题都能解出来。
Creator
bee-san
Size
75.9 MB
Stars
21.7K
Age
7y
Commits · 90 Days