PHP Classes

BmpCrypt: Encrypt and decrypt data hidden in bitmap image

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   Screenshots Screenshots   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-04-21 (9 years ago) RSS 2.0 feedStarStarStarStar 72%Total: 2,818 This week: 6All time: 1,240 This week: 282Up
Version License Categories  
bmpcrypt 1.0.0GNU General Publi...Graphics, Cryptography
Description Author  

BmpCrypt is a class that uses the steganography technique to hide encrypted data within a bitmap image (.BMP).

This class can hide the data very well in 24 or 32 bit RGB images.

The class could be used to hide the data in indexed color images, for instance of 256 colors, but that would require adding a few functions to deal with the modifications to the color palette.

This class implements 4 levels of bit stream encoding. Each level uses an increasing number of bits per each byte in the RGB pixel table. Therefore, the higher level of encoding will hold more bytes of data in the bitmap image.

The class comes with a Web base example that shows how to decrypt an encrypted JPEG out of a BMP file and displays the output image.

There is also an example script that shows how to use the class to encrypt and decrupt data from the command line.

Innovation Award  
PHP Programming Innovation award nominee
April 2005
Number 3

Prize: One book of choice by SAMS
Some sites use digital watermark techniques to mark their images in order to notice when the images are being used without permission by other sites.

However, this does not stop people from cleaning the visible marks and still show them without asking permission or giving proper credit to the original owners. This fact makes it difficult to take legal action.

An alternative solution consists in adding information to the image files that does not show in the image itself. Later, that information could be used to detect and prove that the images files were stollen.

This class provides a solution for encrypting and embedding in image files that can be used later to demonstrate the real origin of the images.

Manuel Lemos
Picture of Chao-Chyuan Shih
Name: Chao-Chyuan Shih <contact>
Classes: 2 packages by
Country: United States United States
Age: 63
All time rank: 72991 in United States United States
Week rank: 333 Up40 in United States United States Up
Innovation award
Innovation award
Nominee: 2x

  • ScreenShot.jpg
  Files folder image Files  
File Role Description
Plain text file BmpCrypt_Class.php Class BmpCrypt
Plain text file BmpCrypt_CmdLine_Example.php Example Command Line Example
Plain text file Decrypt_Webpage_Example.php Example Web Page Example
Image file Dog.bmp Photo Sample Image
Image file Horse.jpg Photo Sample Image
Image file HorseInDog.bmp Output Sample Output
Plain text file readme.txt Doc. Read Me

 Version Control Unique User Downloads Download Rankings  
 0%Total:2,818All time:1,240
 This week:6This week:282Up
 User Ratings  
 All time