steganojs
v1.0.7
Published
Steganography package for PNG files. Can be used in web browser and backend code.
Downloads
24
Maintainers
Readme
SteganoJS
Description
This is a basic steganography library inspired by steganography, using the Lowest Significant Bit (LSB) algorithm.
This package uses the more lightweight pngjs for image parsing, nice ES6+ features, and a pure functional approach. It is designed for programmatic use.
There is currently only support for .png files.
Badges
Visuals
Installation
npm install steganojs
Usage
To conceal a message in an image:
// Import built-in module
import { readFileSync, writeFileSync } from 'fs';
// Import module function
import { conceal } from 'steganojs';
const imageBuffer = readFileSync('./path/to/image.png'); // buffer
const messageToConceal = 'keep it secret, keep it safe'; // string or buffer
// Encoding should be supplied if message is provided as a string in non-default encoding
const encodedFile = conceal(
imageBuffer,
messageToConceal,
/*, optional Buffer Encoding
, optional AES256 encryption password */
);
writeFileSync('./path/to/output.png', encodedFile);
To reveal a message hidden in an image:
// Import built-in module
import { readFileSync } from 'fs';
// Import module function
import { reveal } from 'steganojs';
const imageBuffer = readFileSync('./path/to/image.png'); // buffer
// Returns a string if encoding is provided, otherwise a buffer
const revealedMessage = reveal(
imageBuffer,
/*, optional Buffer Encoding
, optional AES256 encryption password */
);
console.log(revealedMessage.toString());
Support
If you need help, please go to the project issue tracker.
Road map
Tests
- Add Buffer tests
- Add XML/TOML encoding tests
- Add tests on dynamic generated PNG file and buffers
- Add code coverage analysis
CI/CD Pipeline
- Add automatic semantic version numbering for small updates
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
You can also document commands to lint the code or run tests.These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something.
Authors and acknowledgment
This module is a Typescript refactoring of the initial steggy JavaScript module by Will Clark.
I want to thank C-J Kihl for his article on how to publish a TypeScript NPM package and webbureaucrat for his help with Continuously Deploying an NPM Package with GitLab CI/CD.
I want to thank Naereen for his document about README.md badges.
License
Project status
Currently working on the project.