PHP Classes

Msg2Pic: Encode and decode text messages inside pictures

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 52%Total: 402 All time: 6,550 This week: 206Up
Version License PHP version Categories
msg2pic 1MIT/X Consortium ...5PHP 5, Graphics, Cryptography
Description 

Author

This class can encode and decode text messages inside pictures.

It can take a given text converts each of its characters to color values.

The class creates an image of a given width and height setting its pixels of the input text character color values. The generated image is saved in PNG format.

It can also do the opposite, i.e. take a previously generated image and extract the encoded text by decoding the image pixel colors.

A separate class can also take a text to encode but encrypts it with a given key before storing the encoded characters as color pixels.

Picture of Aaron Cox
Name: Aaron Cox <contact>
Classes: 1 package by
Country: United States United States
Age: ???
All time rank: 3541466 in United States United States
Week rank: 321 Up31 in United States United States Up

Example

<?php
/* ------------------------------------------------------------------------------------------------------------------------------------------
    File: example.php
    Author: Aaron Cox ( aaron@gshirt.biz )
    Date: 09/01/2014
    Purpose: To allow the conversion of a message into a b/w picture and vice versa. This would allow messages to be hidden in picture files
    thus adding a degree of stealth to the user's arsenal.
------------------------------------------------------------------------------------------------------------------------------------------ */

require_once( "msg2pic.php" );

/* ------------------------------------------------------------------------------------------------------------------------------------------
    * Message to Convert to B/W Picture:
------------------------------------------------------------------------------------------------------------------------------------------ */

$MESSAGE = <<< EOT

How you can help the United States to win the Championship of 2014?

You can help by doing the following:

1. Submit More Innovative PHP Packages

    If you submit innovative packages you will be nominated to win the month innovation award.
    The site users will vote and all nominees will earn points depending on their position of the month ranking.
    The innovation points that you earn each month will be added to your country score.
    The country that accumulates more points throughout the year will be the Championship Winner of the year.

EOT;

// ------------------------------------------------------------------------------------------------------------------------------------------

$filename = "example.png"; // Filename for picture

$Msg2Pic = new Msg2Pic( $MESSAGE ); // Initiate Msg2Pic Object

$Msg2Pic->output_header(); // Output header for example

$Msg2Pic->message_to_picture( $filename ); // Convert message to image 'example.png'
$Msg2Pic->output_m2p( $filename ); // Output message to picture conversion info

$Msg2Pic->picture_to_message( $filename ); // Convert image 'example.png' to a message
$Msg2Pic->output_p2m( $filename ); // Output picture to message conversion info

?>


Screenshots  
  • genesis.png
  • msg2pic_screenshot.jpg
  • hamlet.png
  • united_states_constitution.png
  • source_code_for_php_wikipedia_page.png
  • php.png
  • bad_words_list.png
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example of how to use Msg2Pic class to convert messages into b/w pictures and vice versa. This would allow messages to be hidden in picture files thus adding a degree of stealth to the user's arsenal.
Accessible without login Plain text file LICENSE.txt Lic. License info for Msg2Pic class
Plain text file msg2pic.php Class Class that includes functionality for the conversion of messages to pictures and vice versa. Also includes functions to output results from coversions and functions for encrypting and decrypting data if the user would like to build upon the capabilities of this class.
Accessible without login Image file msg2pic.png Photo PHP class to convert messages to pictures and vice versa.
Plain text file msg2pic_color.php Class Class that includes functionality for the conversion of messages to color pictures and vice versa. Tests done using this class have found that the final images created are smaller than the plain text documents with the exact same messages!

 Version Control Unique User Downloads Download Rankings  
 0%
Total:402
This week:0
All time:6,550
This week:206Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:52%StarStarStar
Rank:2377