@mrdesjardins/steganography
v0.0.9
Published
Basic Steganography library that add text into an image
Downloads
17
Readme
Steganography TypeScript
Embeded a string into an existing image.
What is Steganography?
Wikipedia defines steganography:
the practice of representing information within another message or physical objec
This library uses a known technic which is to hide the bytes of the message into the bytes of the color.
More information in this blog article about how I implemented the Steganography in this library.
You can find a Rust Steganography implementation on Github.
This library relies on the least significant bits.
What is Least Significant Bits?
How to Use the Library
How to install the Steganography TypeScript Library
npm install --save steganographyts
How to add a string into an image
await addMessageToImage("Your message", "./yourimage.png", "./imagewithmessage.png");
How to add a string into an image with the string encrypted
await addMessageToImage("Your message", "./yourimage.png", "./imagewithmessage.png", {
password: "Your password here",
});
How to extract the string from an image
const message = await getMessageFromImage("./imagewithmessage.png");
How to extract an encrypted string from an image
const message = await getMessageFromImage("./imagewithmessage.png", {
password: "Your password here",
});
Information for Developer
Build
The build produces a EcmaScript Module and a CommonJS Module into the dist
folder. The TypeScript map is generated in both target.
Test
npm run test
Debug
There is a VsCode Launch to debug the unit test. However, if you are running on Windows, you need to ensure you install npm install
on the Windows machine using Powershell and not WSL as the Sharp library install different packages depending if it runs on WSL or Powershell.
How is the Steganography TypeScript working?
If you want to get further detail about how the deta is injected into the image using this library you can follow this blog post.