Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Remove encrypt mode - #37

Merged
tuki0918 merged 7 commits into
mainfrom
feat/remove-encrypt-mode
Nov 7, 2025
Merged

tuki0918 merged 7 commits into
mainfrom
feat/remove-encrypt-mode

Conversation

@tuki0918

@tuki0918 tuki0918 commented Nov 7, 2025

Copy link
Copy Markdown
Owner

No description provided.

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.
Copilot AI review requested due to automatic review settings November 7, 2025 01:59
@tuki0918 tuki0918 linked an issue Nov 7, 2025 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ImageFragmenter and ImageRestorer classes by removing secret key parameters
  • Consolidated type definitions by merging ShortImageInfo into ImageInfo

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.

@tuki0918
tuki0918 merged commit 9bc7bec into main Nov 7, 2025
9 checks passed
@tuki0918
tuki0918 deleted the feat/remove-encrypt-mode branch November 7, 2025 02:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shuffle + Encrypt Mode を廃止する

2 participants