Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

code-image-obfuscator

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-image-obfuscator

merge data and image png

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Thanks for npm~lucasmreis

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'

// loading data example
const before = fs.readFileSync('README.md', 'utf8')

// create new img with data
await Save('./photo.png', before, './new-photo.png')

/* to load data from img */
const after = await Load('./new-photo.png')

/* compare data after recovery */
console.log(before == after)

Example [browser]:

bundleFoundIn => 'code-image-obfuscator/dist/cio.bundle.js'

// loading data example
const before = 'some-data'

// create new img with data
window.cio.Save('element_id_of_img', before, 'element_id_of_canvas')

/* to load data from img */
const after = await window.cio.Load('element_id_of_canvas')

/* compare data after recovery */
console.log(before == after)

Keywords

FAQs

Package last updated on 26 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc