the practice of concealing a file, message, image, or video within another file, message, image, or video - wikipedia
You will need these 2 packages:
There are 5 images with data encoded in them.
The data has the following format:
{
index: 0,
message: 'a secret message...',
}
Using these images:
Use the following decode() function to decode the embedded data.
const jimp = require('jimp');
const lsb = require('lsb');
async function decode(inputImage) {
const image = await jimp.read(inputImage);
const json = lsb.decode(image.bitmap.data, rgb);
return JSON.parse(json);
}
function rgb(n) {
return n + Math.floor(n / 3);
}
/////////////////////////////////////////
// EXAMPLE - This can be deleted
//
async function example() {
const secret = await decode('./a.png');
console.log(secret);
}
example()
//////////////////////////////////////////
Deploy a page that dynamically:
index field encoded in the image. All 5 images should be displayed in the correct order.index. The entire message should be displayed.To get started (with express):
mkdir hackathon
cd hackathon
npm init
npm install --save express lsb jimp