Visualization Steganography: conceal information within visualization images.
npm install @antv/vis-steg- Information Encoding and Decoding: A javascript library for embedding information within visualization images.
The decoding algorithm just relys on the encoded image.
- String and Bits Array Transformation: Converting a string to a bits array and vice versa using UTF8 encoding and decoding.
- QR Code for Error Correction: Add QR code as error correction code before encoding and after decoding.
``bash`
$ npm install
Basic use
- Information Encoding
`ts
import { LSBSteg } from './src';
const testLSBSteg = new LSBSteg();
const secretInfo = 'hello';
testLSBSteg.writeLSB({
imgBitmapData: imgBitmapData,
imgHeight: img.height,
imgWidth: img.width,
secretInfo,
});
`
- Information Decoding
`ts
import { LSBSteg } from './src';
const testLSBSteg = new LSBSteg();
const decodeSecret = testLSBSteg.readLSB({
imgBitmapData: imgBitmapData,
imgHeight: img.height,
imgWidth: img.width,
});
`
with QR Code ECC
- Information Encoding
`ts
import { LSBSteg } from './src';
const testLSBSteg = new LSBSteg();
const secretInfo = 'hello';
testLSBSteg.writeLSB({
imgBitmapData: imgBitmapData,
imgHeight: img.height,
imgWidth: img.width,
secretInfo,
encMode: 'QRcode',
QRSize: 200,
mxMsgLen: 130
});
`
- Information Decoding
`ts
import { LSBSteg } from './src';
const testLSBSteg = new LSBSteg();
const decodeSecret = testLSBSteg.readLSB({
imgBitmapData: imgBitmapData,
imgHeight: img.height,
imgWidth: img.width,
decMode: 'QRcode'
});
`
bash
$ npm run start:demo
`> Try the online demo :point_left:
>
> - Pipeline
> - Vis-Image Transformation
:link: Links
- API Reference
:seedling: Supported Algorithms
- LSB: Least Significant Bit method for image steganography. The binary bits of the secret information was used to replace the bits of container image pixels. The replacing occurs from the least bit to the highest bit to retain the quality of container image.
> ### LSB Encode Process
>
> - ### Input
>
>
`
> - RGB (or gray) Image
> - Secret String
> - Encode Mode
> - Options
> `
>
> - ### Process
>
> 1. Adjust RGB (or gray) image to RGBA form.
> 2. Add a head string for further check.
> 3. Convert the head string, secret string length and secret string to bits array, and merge them together.
> 4. Embed the bits array into the container image. The replacing is from the least bit to the highest bit. > ### LSB Decode Process
>
> - ### Input
>
>
`
> - RGBA Image
> - Decode Mode
> ``MIT