Crypton
Library consisting of explanation and implementation of all the existing attacks on various Encryption Systems, Digital Signatures, Key Exchange, Authentication methods along with example challenges from CTFs
Install / Use
/learn @ashutosh1206/CryptonREADME
Crypton
Crypton is an educational library to learn and practice Offensive and Defensive Cryptography. It is basically a collection of explanation and implementation of all the existing vulnerabilities and attacks on various Encryption Systems (Symmetric and Asymmetric), Digital Signatures, Message Authentication Codes and Authenticated Encryption Systems. Each attack is also supplemented with example challenges from "Capture The Flag" contests and their respective write-ups. Individuals who are already acquainted (or are into CTFs) with this field can use Crypton as a tool to solve challenges based on a particular existing vulnerability.
The library will be continuously updated with attack explanations and CTF challenges! Feel free to email me regarding any suggestions!
I have written a blog post on the timeline of development of this library: https://masterpessimistaa.wordpress.com/2018/08/12/announcing-crypton-an-educational-library-to-learn-offensive-and-defensive-cryptography/
WARNING: The author in no way guarantees that the code is secure. The library is only meant for educational purposes and the code should not be used for implementing in real world. All the example scripts in the library are trivial implementations.
There are different sections in this README:
- Motivation- What motivated me to create this library
- Library Structure- Directory structure of Crypton
- Domain Coverage- What all cryptosystems and attacks are covered in this library
- Future Plans/TODO- Attacks/concepts that are to be included soon
Motivation
Help CTF players and individuals interested in the field of Cryptography provide a platform for learning attacks in crypto and for experienced CTF players to practice challenges systematically divided into attacks associated with different sub-domains in crypto. Also, illustrate through various attack explanations how proper implementation of protocols is crucial.
Library Structure

Domain Coverage
1. Block Ciphers
| S.No. | Topic | Explanation | Impl./Exploit | Challenge# |
|-------|:---------------------------:|:-----------------------------------------------------------------------------------------------:|:------------:|:----------:|
| 1 | Block Cipher Basics- working of block ciphers, padding etc.| <ul><li>- [x] [link]</li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul> |
| 2 | Modes of Encryption- different modes of operation on block ciphers: ECB, CBC, CTR | <ul><li>- [x] [link]</li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul> |
| 3 | Block Size Detection- detect blocksize of a block cipher encrypting data on a remote service| <ul><li>- [x] [link]</li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul> |
| 4 | Mode Detection- detect type of mode of encryption: independent or dependent encryption of blocks| <ul><li>- [x] [link]</li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul> |
| 5 | ECB Byte at a Time- byte at a time decryption of a secret string running on a remote service encrypting input+secret in ECB mode| <ul><li>- [x] [link]</li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [x] [link] </li></ul> |
| 6 | CBC IV Detection- detect the value of Initialisation Vector on a remote service that is encrypting our input using a block cipher in CBC mode| <ul><li>- [x] [link] </li></ul>| <ul><li>- [x] [link] </li></ul> | <ul><li>- [ ] </li></ul> |
| 7 | CBC Bit Flipping Attack- exploiting cookie generation mechanism to login as admin when cookie is generated using a block cipher in CBC mode| <ul><li>- [x] [link] </li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [x] [link] </li></ul> |
| 8 | CBC Byte at a Time- byte at a time decryption of a secret string running on a remote service encrypting input+secret in ECB mode| <ul><li>- [x] [link] </li></ul>| <ul><li>- [x] [link] </li></ul> | <ul><li>- [ ] </li></ul> |
| 9 | CBC Padding Oracle Attack- decryption of data encrypted by a vulnerable service providing encryption/decryption | <ul><li>- [x] [link] </li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [x] [link] </li></ul> |
| 10 | CTR Bit Flipping- exploiting cookie generation mechanism to login as admin when cookie is generated using a block cipher in CBC mode| <ul><li>- [x] [link] </li></ul>| <ul><li>- [ ] </li></ul> | <ul><li>- [x] [link] </li></ul> |
2. RSA Encryption
| S.No. | Topic | Explanation | Impl./Exploit | Challenge# |
|-------|:---------------------------:|:-----------------------------------------------------------------------------------------------:|:------------:|:----------:|
| 1 | Unpadded RSA Enc/Dec- key generation, distribution, encryption/decryption, verification of decryption formula and padding in RSA | <ul><li>- [x] [link] </li></ul> | <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul> |
| 2 | Direct Root Attack- attack on unpadded RSA with low public key exponent | <ul><li>- [x] [link] </li></ul> | <ul><li>- [ ] </li></ul> | <ul><li>- [ ] </li></ul>|
| 3 | Fermat's Factorisation- technique used to factor modulus n when p and q values are in proximity | <ul><li>- [x] [link]</li></ul> | <ul><li>- [x] [link] </li></ul>| <ul><li>- [x] [link] </li></ul> |
| 4 | Pollard's p-1 Factorisation- technique to factorise n when both of it's factors p & q, p-1 and q-1 have very small prime divisors| <ul><li>- [x] [link]</li></ul> | <ul><li>- [x] [link] </li></ul>| <ul><li>- [x] [link] </li></ul> |
| 5 | Common Modulus Attack- decrypt ciphertext when it's corresponding plaintext is encrypted two different times with the same modulus n | <ul><li>- [x] [[link]](https://github.com/ashutosh1206/Crypton/
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
