Merged
Conversation
Add Enigma cipher module: - Introduced `cipher-enigma` module with support for Enigma machine simulation. - Implemented key components: `Rotor`, `RotorState`, `Rotors`, `Reflector`, and `Enigma` core logic. - Added extensive unit tests to validate rotor behavior, reflector mappings, carry logic, and encryption workflow. - Updated `build.sbt` to include `cipher-enigma` module and dependencies.
- Replaced `RotorState` with streamlined `Rotor` model, integrating offset-based transformations. - Introduced `Wheel` abstraction to encapsulate rotor wiring and notch logic, improving modularity. - Added dedicated tests for `Rotor.apply` and `Rotors.apply` settings parsing and validation. - Enhanced encryption tests to validate carry logic, rotor rotations, and backward compatibility. - Minor improvements in `Glyph` extensions and resource loading utilities.
- Enhanced `Settings` to handle rotor position adjustments and improve parsing logic for varied input formats. - Updated `Enigma` encryption and decryption flow to include random positions and keys in messages, to follow German army practice. - Optimized `Glyph` with random glyph generation and added byte conversion extensions. - Refined `Rotors` to expose size, position updates, and enhance stepping mechanism with improved logging. - Adjusted test cases to validate new settings, encryption flow, and message preambles.
- Enhanced `Settings` to handle rotor position adjustments and improve parsing logic for varied input formats. - Updated `Enigma` encryption and decryption flow to include random positions and keys in messages, to follow German army practice. - Optimized `Glyph` with random glyph generation and added byte conversion extensions. - Refined `Rotors` to expose size, position updates, and enhance stepping mechanism with improved logging. - Adjusted test cases to validate new settings, encryption flow, and message preambles.
- Added `PlugBoard` implementation to support plugboard swapping in the Enigma machine. - Updated `Settings` to handle plugboard parsing and validation. - Refactored `Enigma` encryption/decryption logic to integrate plugboard swaps before and after rotor operations. - Expanded unit tests to validate plugboard behavior, settings parsing, and encryption alignment with plugboard configuration.
- Consolidated regex patterns for settings parsing into a single format. - Enhanced error handling in decryption with validation for inconsistent keys. - Adjusted encryption/decryption constructors to replace `base` parameter with `settings`. - Improved Scaladoc formatting for methods, ensuring clarity and adherence to style guidelines.
- Added CLI entry point for the Enigma module using `mainargs` for better command-line handling. - Integrated `sbt-assembly` to enable building executable fat jars with proper merging strategies. - Updated `Settings` to support preamble handling and extracted it into a standalone class. - Enhanced encryption/decryption logic and documentation for improved usability and clarity.
- Moved CLI logic to a dedicated `CLI` object for cleaner architecture and separation of concerns. - Updated `build.sbt` to replace the entry point with the new `CLI` object and implement a self-contained bash script launcher embedding the fat jar. - Enhanced error handling and usage documentation for the `Settings` class, introducing a parsed `Try[Settings]` for better validation flow. - Refined `Settings` parsing with improved exception messaging and preamble formatting.
- Renamed CLI parameters for better clarity (e.g., `decrypt` to `decryptMode`). - Improved processing flow by consolidating operations into `process` and `reportError` methods. - Enhanced preamble encoding/decoding with stricter input validation and error messaging. - Removed redundant imports and streamlined `Settings` handling logic.
- Merged input handling methods (`readAllStdin`, `readFile`) to avoid redundancy. - Introduced `group5` extension for consistent five-letter grouping. - Simplified encoding/decoding workflows by consolidating redundant logic. - Improved readability of `encode` and `decode` methods using streamlined transformations.
- Added comprehensive Scaladoc for the `CLI` object, describing arguments, methods, and extensions. - Improved documentation of encryption/decryption workflows, input handling, and usage examples.
- Added comprehensive Scaladoc for `Rotor`, `Wheel`, `Glyph`, `Rotors`, and `PlugBoard` classes. - Improved clarity on behaviors, constructors, and usage examples in all core Enigma components. - Enhanced validation and operation explanations, aligning documentation with recent refactoring improvements.
- Replaced `IArray` with `Seq` in `Rotors` and `PlugBoard` for improved usability and consistency. - Enhanced `Rotor.toString` for better readability and alignment with user-friendly formatting. - Revised `Settings.parse` regex to enforce consistent spacing, improving input validation. - Simplified `PlugBoardSpec` tests by introducing property-based checks for plugboard behavior. - Added `SettingsSpec` to validate different configurations and edge cases. - Refactored test cases across components to improve clarity, coverage, and maintainability.
ea220aa to
eb3c689
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provides enigma encryption for Cryptid.
Also a cli tool for enigma encryption/decryption