{"id":22656817,"url":"https://github.com/nickory/sabca---simulated-annealing-based-cipher-analysis","last_synced_at":"2025-08-14T08:35:33.278Z","repository":{"id":264167248,"uuid":"892567096","full_name":"Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis","owner":"Nickory","description":"SABCA (Simulated Annealing-Based Cipher Analysis) is a Python library designed for the encryption, decryption, and cracking monoalphabetic substitution ciphers.","archived":false,"fork":false,"pushed_at":"2024-12-30T09:41:10.000Z","size":2236,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T08:11:18.531Z","etag":null,"topics":["cipher","cipher-algorithms","crack"],"latest_commit_sha":null,"homepage":"https://drive.google.com/file/d/100EqMfVo2JEOf7wdOC51h_eAIKZt7EJs/view?usp=drive_link","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nickory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-22T11:05:00.000Z","updated_at":"2024-12-30T09:41:13.000Z","dependencies_parsed_at":"2024-12-30T08:23:01.861Z","dependency_job_id":"6ab67ab0-46e8-4bd6-969d-df1c702b4b2b","html_url":"https://github.com/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis","commit_stats":null,"previous_names":["nickory/sabca---simulated-annealing-based-cipher-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickory%2FSABCA---Simulated-Annealing-Based-Cipher-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickory%2FSABCA---Simulated-Annealing-Based-Cipher-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickory%2FSABCA---Simulated-Annealing-Based-Cipher-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickory%2FSABCA---Simulated-Annealing-Based-Cipher-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nickory","download_url":"https://codeload.github.com/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickory%2FSABCA---Simulated-Annealing-Based-Cipher-Analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270387485,"owners_count":24575012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cipher","cipher-algorithms","crack"],"created_at":"2024-12-09T10:16:34.225Z","updated_at":"2025-08-14T08:35:33.184Z","avatar_url":"https://github.com/Nickory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SABCA - Simulated Annealing-Based Cipher Analysis\n**SABCA** (Simulated Annealing-Based Cipher Analysis) is an method designed for encrypting, decrypting, and cracking monoalphabetic substitution ciphers. It combines **probabilistic language models**, **linguistic syntax analysis**, and **optimization techniques** like **simulated annealing** to provide a robust and automated solution for substitution cipher analysis. \n\nSABCA is implemented with a **graphical user interface (GUI)** and **command-line interface (CLI)** to ensure usability for both beginners and advanced users.\n## 🌟 Features\n- **Automated Cipher Cracking**:  \n  Break monoalphabetic substitution ciphers using simulated annealing and statistical methods.\n- **Encryption/Decryption**:  \n  Encrypt plaintext or decrypt ciphertext using user-provided or randomly generated keys.\n- **Real-Time Visualization**:  \n  GUI includes live charts for decryption progress and fitness score optimization.\n- **Performance Across Text Types**:  \n  Works effectively on both structured (e.g., literature) and unstructured (e.g., technical) text.\n- **Fully Open-Source**:  \n  The full implementation, including a GUI, is open-sourced for reproducibility and educational purposes.\n## 📦 Installation\n### Prerequisites\n- Python 3.8 or higher  \n- Libraries: `nltk`, `matplotlib`, `tkinter`\n\n## 🚀 Latest Version: v1.4.1\n\nThe current version of **SABCA (v1.4.1)** is now available for download.  \nYou can access the program and all its resources from the following Google Drive link:\n\n🔗 **[Download SABCA v1.4.1](https://drive.google.com/file/d/100EqMfVo2JEOf7wdOC51h_eAIKZt7EJs/view?usp=drive_link)**\n\n---\n\n### What's New in v1.4.1\n- Enhanced decryption accuracy with updated quadgram model.\n- Optimized simulated annealing algorithm for faster convergence.\n- Improved GUI with real-time progress updates and visualizations.\n- Bug fixes and performance improvements.\n\n###  Select an option from the menu:\n###     - Encrypt: Input plaintext and receive ciphertext with the key.\n###     - Decrypt: Input ciphertext and a key to decrypt it.\n###     - Crack: Automatically decrypt ciphertext without a key.\n## 🔍 Experiment Details\n### Objectives\n1. Implement a monoalphabetic substitution cipher for encryption and decryption.\n2. Demonstrate statistical vulnerabilities using letter frequency analysis.\n3. Develop an automated cracking method using simulated annealing.\n### Key Insights\n- **Encryption and Decryption**: Successfully implemented a substitution mapping system for consistent encryption-decryption workflows.\n- **Statistical Analysis**: Visualized plaintext and ciphertext letter frequency distributions to reveal encryption patterns and vulnerabilities.\n- **Simulated Annealing Optimization**: Balanced computational efficiency and decryption accuracy using probabilistic language models and iterative refinement of mappings.\n  \n## 📊 Experimental Results\n\n### Visualization of Frequencies\nThe following figure compares the frequency distributions of letters in plaintext and ciphertext:\n\n\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg src=\"images/frequency_distribution.png\" alt=\"Frequency Distribution\" style=\"width: 60%; height: auto; border: 1px solid #ddd; border-radius: 8px; padding: 5px;\"\u003e\n\u003c/div\u003e\n\n### Simulated Annealing Progression\nThe figure below shows the evolution of decryption accuracy and fitness score over iterations:\n\n\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg src=\"images/fitness_progression.png\" alt=\"Fitness Score Progression\" style=\"width: 60%; height: auto; border: 1px solid #ddd; border-radius: 8px; padding: 5px;\"\u003e\n\u003c/div\u003e\n\n### GUI Demonstration\nThe GUI provides real-time feedback on decryption progress and accuracy:\n\n\u003cdiv style=\"text-align: center;\"\u003e\n  \u003cimg src=\"images/gui_demo.png\" alt=\"GUI Demonstration\" style=\"width: 60%; height: auto; border: 1px solid #ddd; border-radius: 8px; padding: 5px;\"\u003e\n\u003c/div\u003e\n\n## 💖 Support Us\n\nHelp us continue improving **SABCA**! You can:\n\n1. **Star the Repository**:  \n   Show your support by starring the GitHub repository.\n\n2. **Contribute**:  \n   Submit issues or pull requests to help improve the project.\n\n3. **Donate**:  \n   Support the project by donating to the QR codes below:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"text-align: center;\"\u003e\n      \u003cp\u003eWeChat\u003c/p\u003e\n      \u003cimg src=\"images/qr_code_wechat.png\" alt=\"WeChat QR Code\" style=\"width: 150px; height: auto;\"\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"text-align: center;\"\u003e\n      \u003cp\u003eAlipay\u003c/p\u003e\n      \u003cimg src=\"images/qr_code_alipay.png\" alt=\"Alipay QR Code\" style=\"width: 150px; height: auto;\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## 📜 Citation\n\nIf you use **SABCA** in your research, please cite:\n  ```bibtex\n     @misc{sabca2024,\n           author = {Ziheng Wang},\n           title = {SABCA: Simulated Annealing-Based Cipher Analysis},\n           year = {2024},\n           howpublished = {GitHub Repository},\n           url = {https://github.com/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis}\n          }\n\n```\n\n\n## 🔗 Links\n- [GitHub Repository](https://github.com/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis)\n- [Documentation](https://github.com/Nickory/SABCA---Simulated-Annealing-Based-Cipher-Analysis/wiki)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickory%2Fsabca---simulated-annealing-based-cipher-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickory%2Fsabca---simulated-annealing-based-cipher-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickory%2Fsabca---simulated-annealing-based-cipher-analysis/lists"}