any-steganography
v1.1.3
Published
Steganography can be done in any type of file
Downloads
9
Maintainers
Readme
any-steganography
How to use!!!
require libs
const fs = require('fs');
const path = require('path');
const sg = require('any-steganography');
define file paths, this can be from a file upload, etc
const file = path.join(__dirname, 'images', 'test.jpg');
const output = path.join(__dirname, 'images', 'test-with-message.jpg');
Let's write our message into a file
first: read file
const key = '<encryption key with length 128>';
const buffer = sg.write(file, 'message', key);
fs.writeFile(output, buffer, (err) => {
if (err) {
console.log(err);
return;
}
});
Now let's make sure it worked as expected
decode message
const buffer = fs.readFileSync(output);
const message = steno.decode(buffer, 'jpg', key);
console.log(message);