{"id":32624958,"url":"https://github.com/felipeandrian/criptofep","last_synced_at":"2025-10-30T20:26:10.910Z","repository":{"id":319195349,"uuid":"1077930468","full_name":"felipeandrian/CriptoFEP","owner":"felipeandrian","description":"A collection of classical ciphers and encoders implemented in Perl.\"","archived":false,"fork":false,"pushed_at":"2025-10-17T23:44:23.000Z","size":3265,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-18T04:47:29.798Z","etag":null,"topics":["classical-cryptography","cryptography-algorithms","cryptography-project","cryptography-tools","ctf-tools","encoder-decoder","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipeandrian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-17T00:40:40.000Z","updated_at":"2025-10-17T23:44:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"194dd224-e133-4fb5-a75c-66e36ba0b7eb","html_url":"https://github.com/felipeandrian/CriptoFEP","commit_stats":null,"previous_names":["felipeandrian/criptofep"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/felipeandrian/CriptoFEP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeandrian%2FCriptoFEP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeandrian%2FCriptoFEP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeandrian%2FCriptoFEP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeandrian%2FCriptoFEP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipeandrian","download_url":"https://codeload.github.com/felipeandrian/CriptoFEP/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeandrian%2FCriptoFEP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281875584,"owners_count":26576691,"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-10-30T02:00:06.501Z","response_time":61,"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":["classical-cryptography","cryptography-algorithms","cryptography-project","cryptography-tools","ctf-tools","encoder-decoder","perl"],"created_at":"2025-10-30T20:26:09.529Z","updated_at":"2025-10-30T20:26:10.904Z","avatar_url":"https://github.com/felipeandrian.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"CriptoFEP.png\" alt=\"CriptoFEP Logo\" width=\"120\"\u003e\n  \u003ch1\u003eCriptoFEP — A Classic Cipher \u0026 Analysis Toolkit\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Build Status](https://img.shields.io/badge/build-passing-green?style=flat-square\u0026logo=github)]()\n[![Coverage](https://img.shields.io/badge/coverage-in%20progress-yellow?style=flat-square)]()\n[![Version](https://img.shields.io/badge/version-1.3.0-blue?style=flat-square)]()\n[![Perl](https://img.shields.io/badge/perl-v5.10+-black?style=flat-square\u0026logo=perl)]()\n[![License](https://img.shields.io/badge/license-MIT-darkgreen?style=flat-square)]()\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n```\n   ___|       _)         |           ____|  ____|   _ \\  \n  |       __|  |  __ \\   __|   _ \\   |      __|    |   | \n  |      |     |  |   |  |    (   |  __|    |      ___/  \n \\____| _|    _|  .__/  \\__| \\___/  _|     _____| _|     \n                 _|                                      \n```\n\n\u003c/div\u003e\n\n**CriptoFEP** is a powerful, educational, and modular command-line toolkit written in **Perl** for experimenting with classic cryptography. It provides a comprehensive arsenal of historical ciphers, modern encodings, and **cryptanalysis tools**, making it the perfect companion for students, historians, puzzle enthusiasts, and Capture The Flag (CTF) competitors.\n\n---\n\n## 📋 Table of Contents\n\n- [✨ Core Features](#-core-features)\n- [📚 Available Algorithms \u0026 Tools](#-available-algorithms--tools)\n- [🚀 Quick Start](#-quick-start)\n- [🛠️ Usage Guide](#️-usage-guide)\n  - [Synopsis](#synopsis)\n  - [Command-Line Options](#command-line-options)\n  - [Practical Examples](#practical-examples)\n- [📂 Project Structure](#-project-structure)\n- [✅ Roadmap](#-roadmap)\n- [🤝 Contributing](#-contributing)\n- [📜 License](#-license)\n\n---\n\n## ✨ Core Features\n\n- **Extensive Library**: A vast collection of over 40 classic ciphers and 15+ standard encodings.\n- **Triple Modes**: Intelligently separates **Ciphers** (secrecy), **Encodings** (representation), and **Analysis** (cryptanalysis).\n- **Cryptanalysis Suite**: Includes tools like Frequency Analysis, Index of Coincidence (IC), and a Polyalphabetic Key Length Detector.\n- **Professional CLI**: A robust and intuitive command-line interface with clear, consistent options.\n- **File I/O**: Seamlessly processes direct text input or entire files.\n- **Full Unicode Support**: Correctly handles a wide range of characters thanks to its UTF-8 architecture.\n- **Dynamic Help \u0026 Listing**: Integrated `--info`, `--list-ciphers`, and `--list-encodings` flags provide detailed explanations.\n- **Modular \u0026 Extensible**: Built with a clean architecture in `lib/CriptoFEP/`, making it easy to maintain and extend.\n\n---\n\n## 📚 Available Algorithms \u0026 Tools\n\nThis is the complete list of algorithms and tools currently supported by CriptoFEP.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand the full list of 40+ Ciphers\u003c/strong\u003e\u003c/summary\u003e\n\n### Ciphers (Algorithms for confidentiality)\n\n| Name               | Requires Key? | Description                                                                |\n| -------------------| :-----------: | ---------------------------------------------------------------------------|\n| **ADFGX**          |      Yes      | The original 5x5 WWI German field cipher combining Polybius and columnar.  |\n| **ADFGVX**         |      Yes      | The advanced 6x6 version of ADFGX, including numbers.                      |\n| **Affine**         |      Yes      | A mathematical substitution cipher using `(ax + b) mod 26`.                |\n| **Albam**          |      No       | A simple substitution cipher that swaps the two halves of the alphabet.    |\n| **AMSCO**          |      Yes      | An irregular columnar transposition using a 1-2 fill pattern.              |\n| **Atbah**          |      No       | A simple substitution cipher with a specific, non-sequential mapping.      |\n| **Atbash**         |      No       | A simple substitution cipher that reverses the alphabet (A=Z, B=Y...).     |\n| **Bacon**          |      No       | A 5-bit binary encoding that maps letters to sequences of 'A's and 'B's.   |\n| **Beaufort**       |      Yes      | A reciprocal polyalphabetic cipher, similar to Vigenere (C = K - P).       |\n| **Bifid**          |      Yes      | A fractionating cipher combining Polybius with transposition.              |\n| **Caesar**         |      No       | The classic shift cipher (fixed shift of 3).                               |\n| **Caesar Box**     |      Yes      | A simple columnar transposition where columns are read in natural order.   |\n| **Columnar**       |      Yes      | A transposition cipher that rearranges text in columns based on a keyword. |\n| **Digrafid**       |      Yes      | An advanced fractionating cipher operating on digraphs with a 25x25 grid.  |\n| **Double Columnar**|      Yes      | Applies the Columnar Transposition cipher twice for enhanced security.     |\n| **Four-Square**    |      Yes      | A polygraphic cipher using four 5x5 grids to encrypt digraphs.             |\n| **Grandpré**       |      Yes      | A progressive-key polyalphabetic cipher (stronger Vigenere).               |\n| **Hill**           |      Yes      | A polygraphic cipher using linear algebra (matrix multiplication).         |\n| **Keyboard Shift** |      No       | A substitution cipher based on shifting keys on a QWERTY keyboard.         |\n| **Morbit**         |      No       | A fractionating cipher that combines Morse code with a simple 3x3 grid.    |\n| **Multiplicative** |      Yes      | A mathematical substitution cipher using `(ax) mod 26`.                    |\n| **Nihilist**       |      Yes      | A superencipherment combining a Polybius square with a key addition.       |\n| **Playfair**       |      Yes      | The first practical polygraphic substitution cipher, using one 5x5 grid.   |\n| **Pollux**         |      Yes      | A homophonic cipher that disguises Morse code using a numeric key.         |\n| **Porta**          |      Yes      | A reciprocal polyalphabetic cipher using 13 substitution tables.           |\n| **Rail Fence**     |      Yes      | A transposition cipher that writes text in a zig-zag pattern.              |\n| **Redefence**      |      Yes      | A route cipher that writes text column-by-column and reads row-by-row.     |\n| **ROT13**          |      No       | A Caesar cipher with a fixed shift of 13.                                  |\n| **ROT47**          |      No       | A Caesar cipher that shifts all printable ASCII characters.                |\n| **Route**          |   \tYes\t     | A transposition cipher that writes text in a clockwise inward spiral path. |\n| **Scytale**        |      No       | An ancient transposition cipher simulating a cylinder (fixed at 5 rows).   |\n| **Skip**           |      Yes      | A simple transposition equivalent to a Caesar Box or basic Columnar.       |\n| **Three-Square**   |      Yes      | A polygraphic cipher using three 5x5 grids.                                |\n| **Trifid**         |      Yes      | An advanced fractionating cipher using a 3x3x3 cube.                       |\n| **Trithemius**     |      No       | The first documented polyalphabetic cipher (progressive Caesar shift).     |\n| **Turning Grille** |      No       | A transposition cipher using a rotating stencil with a fixed 6x6 grid.     |\n| **Two-Square**     |      Yes      | A polygraphic cipher using two 5x5 grids.                                  |\n| **VIC**            |      Yes      | A highly complex Cold War spy cipher.                                      |\n| **Vigenère(auto)** |      Yes      | The more secure \"Autokey\" variant of the Vigenère cipher.                  |\n| **Vigenère**       |      Yes      | The classic polyalphabetic cipher using a repeating keyword.               |\n| **XOR**            |      Yes      | A modern, bitwise symmetric cipher.                                        |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand the full list of 15+ Encodings\u003c/strong\u003e\u003c/summary\u003e\n\n### Encodings (Standard, keyless mappings for representation)\n\n|    Name     |                              Description                                  |\n| :---------- | :------------------------------------------------------------------------ |\n| **A1Z26**   | Replaces each letter with its position in the alphabet (A=1, B=2...).     |\n| **Base10**  | Converts characters to their standard decimal code point (ASCII/Unicode). |\n| **Base16**  | Represents binary data using the 16-character hexadecimal set (0-9, A-F). |\n| **Base2**   | Represents data in its fundamental binary format (0s and 1s).             |\n| **Base32**  | Represents binary data using a 32-character set (A-Z, 2-7).               |\n| **Base64**  | Represents binary data using a 64-character set. Ubiquitous on the web.   |\n| **Base8**   | Represents binary data using the 8-character octal set (0-7).             |\n| **Braille** | Encodes characters into 8-dot Braille Unicode symbols.                    |\n| **Morse**   | The classic dot-and-dash telecommunication code.                          |\n| **NATO**    | The standard NATO phonetic alphabet (Alpha, Bravo, Charlie...).           |\n| **Navajo**  | The famous word-based code used by the WWII Code Talkers.                 |\n| **T9**      | The multi-press keypad encoding from older mobile phones.                 |\n| **Tap Code**| A Polybius-based code transmitted via taps, used by prisoners.            |\n| **URL**     | Encodes unsafe characters for use in a URL (Percent-Encoding).            |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand the full list of Cryptanalysis Tools\u003c/strong\u003e\u003c/summary\u003e\n\n### Cryptanalysis Tools (Tools for analyzing and breaking ciphers)\n\n|       Tool     |                                     Description                                       |\n| :------------- | :------------------------------------------------------------------------------------ |\n| **freq**       | Performs a full frequency analysis of a text, suggesting likely letter substitutions. |\n| **ic**         | Calculates the **Index of Coincidence (IC)** to help identify the cipher type.        |\n| **poly-detect**| Analyzes text to find the most probable key length of a polyalphabetic cipher.        |\n| **digram**     | Performs a frequency analysis on letter pairs (digrams).                              |\n| **trigram**    | Performs a frequency analysis on letter trios (trigrams).                             |\n| **poly-solve** | Attempts to find the key for a polyalphabetic cipher given a key length.              |\n\n\u003c/details\u003e\n\n---\n\n## 🚀 Quick Start\n\n**1. Clone the Repository**\n```bash\ngit clone [https://github.com/felipeandrian/CriptoFEP.git](https://github.com/felipeandrian/CriptoFEP.git)\ncd CriptoFEP\n````\n\n**2. Display the Help Message**\nThe first command you should run is `-h` to see all available options.\n\n```bash\nperl criptofep.pl -h\n```\n\n**3. List Available Algorithms**\nTo see a quick overview of all supported algorithms, use the list commands.\n\n```bash\nperl criptofep.pl --list-ciphers\nperl criptofep.pl --list-encodings\n```\n\n-----\n\n## 🛠️ Usage Guide\n\n### Synopsis\n\nCriptoFEP operates in three distinct modes: **Cipher**, **Encoding**, and **Analysis**.\n\n```bash\n# Cipher Mode (for algorithms that hide information)\nperl criptofep.pl -c \u003ccipher\u003e [-e|-d] [options...] [\"text\" | --in \u003cfile\u003e]\n\n# Encoding Mode (for standard, keyless representations)\nperl criptofep.pl -m \u003cmapping\u003e [--encode|--decode] [\"text\" | --in \u003cfile\u003e]\n\n# Analysis Mode (for cryptanalysis tools)\nperl criptofep.pl -a \u003ctool\u003e [--lang \u003clg\u003e] [\"text\" | --in \u003cfile\u003e]\n\n# Utility Mode (for helper tools)\nperl criptofep.pl --validate-key \u003ccipher\u003e \u003ckey\u003e\n```\n\n### Command-Line Options\n\n#### **General Options**\n\n| Option             | Description                                       |\n| ------------------ | ------------------------------------------------- |\n| `-h`, `--help`     | Display the full help message and exit.           |\n| `--list-ciphers`   | Display all ciphers                               |\n| `--list-encodings` | Display all encodings                             |\n| `--in \u003cFILE\u003e`      | Read input text from the specified file.          |\n| `--out \u003cFILE\u003e`     | Write the output to the specified file.           |\n\n#### **Mode Selection (Choose ONE)**\n\n| Option                  | Description                                                                |\n| ----------------------- | ---------------------------------------------------------------------------|\n| `-c`, `--cipher \u003cNAME\u003e` | Selects **Cipher Mode** and specifies the cipher.                          |\n| `-m`, `--mapping \u003cNAME\u003e`| Selects **Encoding Mode** and specifies the mapping.                       |\n| `-a`, `--analyze \u003cTOOL\u003e`| Select **Analysis Mode** (e.g., `freq`, `ic`, `poly-detect`,`poly-solve`). |\n| `--validate-key \u003cNAME\u003e` |\tSelect Utility Mode to validate a key (e.g., hill).                        |\n\n#### **Actions (Choose ONE per mode)**\n\n| Option            | Description                                                         |\n| ----------------- | ------------------------------------------------------------------- |\n| `-e`, `--encrypt` | Cipher mode Encrypt the input text.                                 |\n| `-d`, `--decrypt` | Cipher mode Decrypt the input text.                                 |\n| `-enc`,`--encode` | Encoding mode Encode the input text.                                |\n| `-dec`,`--decode` | Encoding mode Decode the input text.                                |\n| `--info`          | Display detailed information about the selected algorithm.          |\n| `--lang \u003clg\u003e`     | Specify the language profile for analysis (e.g., `en`, `pt`, `fr`). |\n| `--klen \u003cLEN\u003e`\t| Specify the key length (required for poly-solve).                   |\n\n#### **Cipher-Specific Keys**\n\n| Option                | Description                                                          |\n| --------------------- | -------------------------------------------------------------------- |\n| `-k`, `--key \u003cKEY\u003e`   | Provide the primary secret key.                                      |\n| `-k2`, `--key2 \u003cKEY\u003e` | Provide the second key (for `doublecolumnar`, `twosquare`, etc.).    |\n| `-k3`, `--key3 \u003cKEY\u003e` | Provide the third key (for 'threesquare').                           |\n| `--grid-key \u003cKEY\u003e`    | Provide the grid generation key (for `adfgx`, `adfgvx`).             |\n| `--pattern-key \u003cVAL\u003e` | Provide the pattern key (for `amsco`, e.g., \"1221\").                 |\n| `--date \u003cDATE\u003e`       | Provide the date (for 'vic' cipher).                                 |\n\n### Practical Examples\n\n**1. Encrypt with the VIC cipher**\n\n```bash\nperl criptofep.pl -c vic -e -k \"A SIN TO SIN\" --date \"171025\" \"ATTACK AT DAWN\"\n```\n\n**2. Decode a Base64 string**\n\n```bash\nperl criptofep.pl -m base64 --decode \"SGVsbG8gV29ybGQ=\"\n```\n\n**3. Analyze a ciphertext to find its key length**\n\n```bash\nperl criptofep.pl -a poly-detect --lang en \"VPOVEWZTVMVIXRKSVIUGZGSVGIZBHOLYRZMZKKILEZXS\"\n```\n\n**4. Check the Index of Coincidence of a text**\n\n```bash\nperl criptofep.pl -a ic \"VPOVEWZTVMVIXRKSVIUGZGSVGIZBHOLYRZMZKKILEZXS\"\n```\n\n**5. Encode a file's content using the NATO alphabet and save it to another file**\n\n```bash\nperl criptofep.pl -m nato --encode --in message.txt --out nato_encoded.txt\n```\n\n**6. Get detailed information about the historic Playfair cipher**\n\n```bash\nperl criptofep.pl -c playfair --info\n```\n\n**7. Break a Vigenère Cipher (Two-Step Attack)**\n\nStep 1: Find the key length with poly-detect.\n\n```bash\nperl criptofep.pl -a poly-detect \"GZTZIWTTZBVVMPMVVLJRIVEXSOTUDXCZLZXTHSMIRLTDHCZPVVCXUZSPVSNSVLSOIFVIIH\nKJEYIEVIIGKKEIGKHPJWUHFPREPOIETIEH\"\n```\n(Output: ...The most probable fundamental key length is 5.)\n\nStep 2: Solve for the key using the length you found.\n\n```bash\nperl criptofep.pl -a poly-solve -klen 5 \"GZTZIWTTZBVVMPMVVLJRIVEXSOTUDXCZLZXTHSMIRLTDHCZPVVCXUZSPVSNSVLSOIFVIIH\nKJEYIEVIIGKKEIGKHPJWUHFPREPOIETIEH\"\n```\n(Output: ...The most probable key is 'CHAVE'.)\n-----\n\n## 📂 Project Structure\n\n```\n.\n├── 📜 criptofep.pl          # The main command-line interface (controller)\n│\n├── 📂 lib/\n│   └── 📂 CriptoFEP/       # Directory for all Perl modules (the core logic)\n│       ├── 📜 Utils.pm     # Shared helper functions (e.g., text normalization)\n│       ├── 📜 Analyzer.pm  # The cryptanalysis module\n│       ├── 📜 Cesar.pm     # Each cipher has its own dedicated module...\n│       ├── 📜 Morse.pm     # Each encoding has its own dedicated module...\n│       └── ...           # ...and so on for all algorithms\n│\n├── 🔬 t/                   # Directory for the automated test suite\n│   ├── 📜 01-cesar.t     # Each module has a corresponding test file...\n│   └── ...\n│\n├── 📄 README.md              # This documentation file\n│\n└── ⚖️ LICENSE               # The MIT License for the project\n```\n\n-----\n\n## ✅ Roadmap\n\n  - [x] Implement a comprehensive library of classic ciphers and encodings.\n  - [x] Create a professional, modular architecture.\n  - [x] Add a robust command-line interface with file I/O and dynamic help.\n  - [x] Implement a powerful cryptanalysis suite (Freq Analysis, IC, Key Length Detector).\n  - [ ] **Next Up**: Complete the automated test suite to achieve 100% coverage.\n  - [ ] Add more unique and challenging ciphers (e.g., Book Cipher, Enigma).\n  - [ ] Create a `LEIA-ME.md` file with a full Portuguese translation.\n\n-----\n\n## 🤝 Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\n\n-----\n\n## 📜 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeandrian%2Fcriptofep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipeandrian%2Fcriptofep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeandrian%2Fcriptofep/lists"}