CODE IMAGE OBFUSCATOR
This library lets you store any data inside any image and retrieve it later.
It can be a text, a script or another image.
Please use it responsibly! Do not use it for an illegal purpose.
Motivation
Attempt to hide a javascript file during transmission.
Attention
Support only png without transparency. Because the transparency destroy the data
First Steps
- for install canvas see npm-canvas
- npm install code-image-obfuscator
Example [nodejs]:
import fs from 'fs'
import { Save, Load } from 'code-image-obfuscator'
const before = fs.readFileSync('README.md', 'utf8')
await Save('./photo.png', before, './new-photo.png')
const after = await Load('./new-photo.png')
console.log(before == after)
Example [browser]:
bundleFoundIn => 'code-image-obfuscator/dist/cio.bundle.js'
const before = 'some-data'
window.cio.Save('element_id_of_img', before, 'element_id_of_canvas')
const after = await window.cio.Load('element_id_of_canvas')
console.log(before == after)