steganojs
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

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

Npm package version

Minimum node.js version

Npm package license

Npm package total downloads

Visuals

LSB Steganography

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

AGPL 3.0

Project status

Currently working on the project.

Package Sidebar

Install

npm i steganojs

Weekly Downloads

0

Version

1.0.7

License

AGPL 3.0

Unpacked Size

50.7 kB

Total Files

15

Last publish

Collaborators

  • danes99