Cipher Whisperer is a software project that aims to decrypt and analyze cipher texts using a graph-based approach. The project utilizes various software libraries and tools to process and transform the input text.
The system takes in a text, extracts a single cipher text block from it and detects what suspected ciphers it matches with a probability of above 70% confidence level. Lastly the system calls the respective decryptors on the cipher text in an attempt to decrypt it correctly.
- Python 3 as the primary programming language
dotenvfor environment variable managementlanggraphfor graph-based processing and transformationlangchain_coreandlangchain_openaifor natural language processing and AI-powered decryptionpydanticfor data validation and parsing
The project features a range of decryptors, including:
- BruteForceDecryptor: a brute-force decryptor that uses a list of English words to decrypt the follow ciphers: Caesar, Atbash, Affine, Bacon, Transposition
- Other decryptors (to be added in future updates)
Future work include:
- Adding a reflection component to the system that analyzes the output after the first run and tries again.
- Adding the ability to extract multiple cipher text blocks from a given text.
- Python 3
- Required libraries:
dotenv,langgraph,langchain_core,langchain_openai,pydantic
- Clone this repository.
- Create a virtual environment.
- Install the required libraries:
pip install -r requirements.txt - Create a
.envfile with your environment variables (i.e. API keys) following the.env.examplefile
- Run the main script:
python main.py - Follow the prompts to input a cipher text and receive the decrypted output
cipherwhisperer/: main project directorymain.py: entry point for the projectgraph.py: graph-based processing and transformation of input textchains.py: chain-based processing and transformation of input textmodels.py: data models for the project (e.g.GraphState)decryptors.py: decryptor implementations (e.g. BruteForceDecryptor).gitignore: ignore file for Git
Contributions are welcome! Please submit a pull request with your changes and a brief description of what you've added or fixed.
This project is licensed under the MIT License. See LICENSE for details.
- Yuan, Y., Jiao, W., Wang, W., Huang, J., He, P., Shi, S., & Tu, Z. (2024). GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Cipher. In The Twelfth International Conference on Learning Representations Link Here.

