This repository was archived by the owner on Dec 4, 2025. It is now read-only.
Repository navigation
Remove encrypt mode - #37
Merged
Merged
Conversation
Modified the seed property in FragmentationConfig interface to accept both number and string types, enhancing flexibility in configuration options.
…d restoration - Updated README to reflect the removal of encryption options and modes. - Refactored CLI commands to focus solely on image fragmentation without encryption. - Removed secret key handling from relevant interfaces and classes. - Adjusted tests to align with the new functionality, ensuring they focus on fragmentation only.
- Deleted CryptoUtils and NodeCryptoProvider classes to streamline the codebase. - Updated imports in index and test files to remove references to the removed crypto functionality. - Adjusted image fragmenter to use native crypto methods directly, enhancing performance and reducing dependencies.
- Removed the imageBufferToPng function and integrated its logic directly into createPngFromImageBuffer for clarity. - Simplified the _processSourceImages and _processSourceImage methods in ImageFragmenter by eliminating unnecessary parameters and improving readability. - Updated the _createFragmentImage method to calculate block count directly from the provided blocks, enhancing efficiency. - Refactored image restoration logic to improve buffer handling and streamline block extraction from fragment images.
…torer - Updated the ImageFragmenter and ImageRestorer classes to use the full ImageInfo interface instead of the shortened version. - Removed the _mapImageInfosToShortFormat method to streamline image information handling. - Adjusted related methods to accommodate the new structure of ImageInfo, enhancing clarity and consistency across the codebase.
- Added a new utility function, generateManifestId, to encapsulate the logic for generating unique manifest IDs using crypto. - Updated the ImageFragmenter class to utilize the new utility function instead of directly calling crypto.randomUUID, enhancing code clarity and maintainability.
- Introduced RGBA_CHANNELS constant and BlockCounts interface to improve clarity in block calculations. - Added calculateBlockCounts function for determining block counts based on image dimensions and block size. - Refactored tests for calcBlocksPerFragment to ensure comprehensive coverage of various scenarios, including edge cases. - Removed redundant test cases to streamline the test suite.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes encryption functionality from the image-shield library, simplifying it to focus solely on image fragmentation through shuffling. The changes eliminate all cryptographic operations while maintaining the core fragmentation and restoration capabilities.
Key Changes:
- Removed all encryption/decryption functionality and related dependencies
- Simplified the
ImageFragmenterandImageRestorerclasses by removing secret key parameters - Consolidated type definitions by merging
ShortImageInfointoImageInfo
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/node/src/utils.ts |
Added new utility file with generateManifestId() function to replace crypto provider dependency |
packages/node/src/restorer.ts |
Removed decryption logic and secret key handling; simplified to basic restoration |
packages/node/src/restorer.test.ts |
Removed encryption-related tests; updated test names and simplified assertions |
packages/node/src/index.ts |
Removed secretKey parameter handling from encrypt/decrypt operations |
packages/node/src/index.test.ts |
Removed encryption-related test setup and assertions |
packages/node/src/fragmenter.ts |
Removed encryption logic, secret key handling, and simplified image processing flow |
packages/node/src/fragmenter.test.ts |
Removed encryption-related tests |
packages/node/src/crypto.ts |
Deleted entire file containing Node.js crypto provider implementation |
packages/node/src/block.ts |
Removed encryption/decryption functions and related helper utilities; improved error handling |
packages/node/src/block.test.ts |
Reorganized test structure and removed duplicate test suite |
packages/core/src/types.ts |
Removed encryption-related fields from interfaces; merged ShortImageInfo into ImageInfo; changed seed type to support both number and string |
packages/core/src/index.ts |
Removed crypto module export |
packages/core/src/helpers.ts |
Removed verifySecretKey function |
packages/core/src/helpers.test.ts |
Removed tests for verifySecretKey function |
packages/core/src/crypto.ts |
Deleted entire file containing crypto utilities and provider interface |
packages/core/src/block-utils.ts |
Added RGBA_CHANNELS constant, BlockCounts interface, and calculateBlockCounts function (moved from block.ts) |
packages/cli/src/types.ts |
Removed key option from encrypt and decrypt option interfaces |
packages/cli/src/commands/encrypt.ts |
Removed encryption key option; updated descriptions and console messages |
packages/cli/src/commands/decrypt.ts |
Removed decryption key option; updated console messages |
packages/cli/README.md |
Updated documentation to reflect fragmentation-only functionality |
README.md |
Removed encryption mode documentation and examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.