Coder Social home page Coder Social logo

pyrou / morpheus Goto Github PK

View Code? Open in Web Editor NEW
25.0 6.0 8.0 89 KB

Stop reading matrix, write on it ! Library to encrypt and decrypt data in colors of a picture. Process also known as steganography

Home Page: https://pyrou.github.io/morpheus

License: MIT License

PHP 100.00%
php gd-library steganography imagemagick intervention-image

morpheus's Introduction

Morpheus (莫菲斯)

License
Code Climate

Morpheus is a library to encrypt and decrypt data in colors of a picture. Process also known as steganography.

The project works regardless with imageMagick, GD library, or the well written intervention library.

Installing via Composer

The recommended way to install Morpheus is through Composer.

composer require pyrou/morpheus

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

How to use it

With GD library

# write data in image
$im = imagecreatefrompng("source.png");
Morpheus\Data::write("Helloworld", $im);
imagepng($im, "output.png");

# read data from image
$im = imagecreatefrompng("output.png");
assert("Helloworld" === Morpheus\Data::read($im));

With Image Magick

# write data in image
$im = new Imagick("source.png");
Morpheus\Data::write("Helloworld", $im);
$im->writeImage("output.png");

# read data from image
$im = new Imagick("output.png");
assert("Helloworld" === Morpheus\Data::read($im));

How does it work ?

Let's explain how it works with an example. Consider this beautiful octocat.

input

require 'vendor/autoload.php';
$im = imagecreatefrompng("source.png");
$data = base64_encode(
    "L'homme est un homme tant qu'il s'évertue ".
    "à s'élever au dessus de la nature, et cette ".
    "nature est à la fois intérieure et extérieure.");
Morpheus\Data::write($data, $im);
imagepng($im, "output.png");

Bellow is how humans and computers (or perspicuous humans) can see the output.png file.

source.png output.png --debug*
input output.png What library sees

In fact, the library has slightly changed the coloration of each pixels in upper-half of the file. So slightly that human eyes are NOT able to detect it.

*For understand what Morpheus did, and what he sees now.

morpheus's People

Contributors

pyrou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

morpheus's Issues

Read data inside image

Is possible to read the data inside the image without knowing the text or data that are stored inside the image? This is not really clear inside the documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.