
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
image-shield
Advanced tools

This npm package provides functionality for image fragmentation and restoration.
This package provides two main modes for image fragmentation:
secretKey is not set, only shuffling is performed.Original Image → Load → Convert to RGBA → Shuffle → Fragmented PNG Output`
secretKey is set, both shuffling and encryption are performed.Original Image → Load → Convert to RGBA → Encrypt → Shuffle → Fragmented PNG Output`
npm i image-shield
import ImageShield from "image-shield";
If you do not set the secretKey, only shuffling will be applied to the images.
Encrypt
await ImageShield.encrypt({
// config: { /** FragmentationConfig */ },
imagePaths: [
"./input_1.png",
"./input_2.png",
"./input_3.png",
],
outputDir: "./output/fragmented",
// secretKey: undefined
});
output
└── fragmented
├── img_1_fragmented.png
├── img_2_fragmented.png
├── img_3_fragmented.png
└── manifest.json
| input 1 | input 2 | input 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 500 x 500px (109KB) | 400 x 600px (4KB) | 600 x 400px (3KB) |
| output 1 | output 2 | output 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 494 x 494px (334KB) | 494 x 494px (335KB) | 494 x 494px (334KB) |
Decrypt
await ImageShield.decrypt({
manifestPath: "./output/fragmented/manifest.json",
imagePaths: [
"./output/fragmented/img_1_fragmented.png",
"./output/fragmented/img_2_fragmented.png",
"./output/fragmented/img_3_fragmented.png",
],
outputDir: "./output/restored",
// secretKey: undefined
});
output
└── restored
├── img_1.png
├── img_2.png
└── img_3.png
| input 1 | input 2 | input 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 494 x 494px (334KB) | 494 x 494px (335KB) | 494 x 494px (334KB) |
| output 1 | output 2 | output 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 500 x 500px (117KB) | 400 x 600px (2KB) | 600 x 400px (2KB) |
If you set the secretKey, both shuffling and encryption will be applied to the images.
Encrypt
await ImageShield.encrypt({
// config: { /** FragmentationConfig */ },
imagePaths: [
"./input_1.png",
"./input_2.png",
"./input_3.png",
],
outputDir: "./output/fragmented",
secretKey: "secret",
});
output
└── fragmented
├── img_1_fragmented.png
├── img_2_fragmented.png
├── img_3_fragmented.png
└── manifest.json
| input 1 | input 2 | input 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 500 x 500px (109KB) | 400 x 600px (4KB) | 600 x 400px (3KB) |
| output 1 | output 2 | output 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 494 x 494px (976KB) | 494 x 494px (976KB) | 494 x 494px (976KB) |
Decrypt
await ImageShield.decrypt({
manifestPath: "./output/fragmented/manifest.json",
imagePaths: [
"./output/fragmented/img_1_fragmented.png",
"./output/fragmented/img_2_fragmented.png",
"./output/fragmented/img_3_fragmented.png",
],
outputDir: "./output/restored",
secretKey: "secret",
});
output
└── restored
├── img_1.png
├── img_2.png
└── img_3.png
| input 1 | input 2 | input 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 494 x 494px (976KB) | 494 x 494px (976KB) | 494 x 494px (976KB) |
| output 1 | output 2 | output 3 |
|---|---|---|
![]() | ![]() | ![]() |
| 500 x 500px (117KB) | 400 x 600px (2KB) | 600 x 400px (2KB) |
| input | blockSize: 1 | blockSize: 2 (default) | blockSize: 3 | blockSize: 4 |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
| blockSize: 8 | blockSize: 16 | blockSize: 32 | blockSize: 50 | blockSize: 128 |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
blockSize: 50
| input 1 | input 2 | input 3 |
|---|---|---|
![]() | ![]() | ![]() |
| output 1 | output 2 | output 3 |
|---|---|---|
![]() | ![]() | ![]() |
manifest.json:
{
"id": "cd3c6a30-17ed-4893-85ea-8e644ab1a4a1",
"version": "0.8.0",
"timestamp": "2025-07-10T00:21:16.699Z",
"config": {
"blockSize": 2,
"prefix": "img",
"seed": 860865,
"restoreFileName": false
},
"images": [
{
"w": 501,
"h": 500,
"c": 4,
"x": 251,
"y": 250
},
{
"w": 490,
"h": 490,
"c": 4,
"x": 245,
"y": 245
},
{
"w": 490,
"h": 490,
"c": 4,
"x": 245,
"y": 245
}
],
"algorithm": "aes-256-cbc",
"secure": true
}
[!NOTE]
- The recommended mode is Shuffle + Encrypt for better security.
- The
manifest.jsonfile contains the necessary information for restoration, but it does not include the secret key.- Input images are converted to PNG format.
FAQs
Image fragmentation and restoration.
The npm package image-shield receives a total of 28 weekly downloads. As such, image-shield popularity was classified as not popular.
We found that image-shield demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.