Steganographer is a JavaScript/TypeScript library used to encode secret messages inside images and to decode them again. The original project is from https://github.com/petereigenschink/steganography.js by Peter Eigenschink - steganographer removed unused code, adds some quality of life improvements, and allows this to be used easily as a module in JavaScript or TypeScript projects.
https://hyundotio.github.io/steganographer/dist
Behind the scenes steganographer uses an algorithm to convert the given message into appropriate binary data which then will be hidden in the alpha channel of the given cover image. A HTML5 canvas element is then used to process the data and the image. To decode a message from a given image, a similiar algorithm is applied on the imagedata.
The use of the library is very simple.
-
For plain HTML, download
steganographer.js
file from the/dist
folder and add<script src="./steganographer.js"></script>
and callSteg.decode
andSteg.encode
-
When using it as a module, download steganographer from npm:
npm i steganographer
and addimport { decode, encode } from 'steganographer'
and plainly calldecode
andencode
in your project. -
encode
takes a message as String and a image asHTMLImageElement
orstring
representing the data-URL of the cover image. Returns the data-URL of the image with the encoded message inside. -
decode
takes a image asHTMLImageElement
orstring
representing the data-URL of the image and returns the message which was found in the image.
npm run build
or
yarn build
MIT