@antv/vis-steg
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha.1 • Public • Published

@antv/vis-steg

Visualization Steganography: conceal information within visualization images.

Features

  • 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.

📦 Installation

$ npm install

🔨 Getting Started

Basic use

  • Information Encoding
import { LSBSteg } from './src';

const testLSBSteg = new LSBSteg();
const secretInfo = 'hello';
testLSBSteg.writeLSB({
  imgBitmapData: imgBitmapData,
  imgHeight: img.height,
  imgWidth: img.width,
  secretInfo,
});
  • Information Decoding
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
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
import { LSBSteg } from './src';

const testLSBSteg = new LSBSteg();
const decodeSecret = testLSBSteg.readLSB({
  imgBitmapData: imgBitmapData,
  imgHeight: img.height,
  imgWidth: img.width,
  decMode: 'QRcode'
});

🍪 Demo

$ npm run start:demo

Try the online demo 👈

🔗 Links

🌱 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
    
    • Process

    1. Read the head string for decoding check.
    2. Read the secret string length (64 bits).
    3. Read the secret string bits array and convert it to string.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @antv/vis-steg

Weekly Downloads

8

Version

0.1.0-alpha.1

License

MIT

Unpacked Size

113 kB

Total Files

49

Last publish

Collaborators

  • xuying1027
  • lvisei
  • yisi.wang
  • basketduck
  • biupiubiupiu
  • flash1
  • dreammy23
  • laixingui.lxg
  • zhangjunjie-loki
  • rainy25ghz
  • zeyuwang
  • yanxiong
  • susiwen8
  • freestyle21
  • soundquiet
  • elaine.q.10
  • sturuby
  • sakuya223
  • serializedowen
  • xdzhao
  • yangzhanmei
  • wjgogogo
  • leungwensen
  • dori
  • iaaron
  • yard
  • simaq
  • dxq613
  • intchous
  • susan_ann
  • jinke.li
  • lzxue
  • army8735
  • atool
  • baizn
  • dengfuping
  • neoddish
  • jeffy2012
  • zqlu
  • afc163
  • pomelo-nwu
  • kopiluwaky
  • ccnuzindex
  • panyuqi
  • bubkoo
  • zengyue
  • kasmine
  • boyu.zlj
  • l1ud0ngq1
  • newbyvector
  • winniexing
  • chenluli
  • kn9117
  • xdddst
  • semious2020
  • esora
  • nadia_liu
  • bbsqq
  • mxz96102
  • openwayne
  • pearmini
  • pddpd
  • yiqianyao
  • zhanba
  • cxxxxxn