picamator/steganographykit
最新稳定版本:1.1.0
Composer 安装命令:
composer require picamator/steganographykit
包简介
Implementation several steganography algorithms
README 文档
README
Master
Dev
SteganographyKit is a package with implementation several algorithms for image Steganography.
Steganography is the art and science of hiding information by embedding messages within other, seemingly harmless messages [1]. General overview of Steganography can be found in [3], [7]. SteganographyKit is used terminology described by Christian Cachin [1].
SteganographyKit contains:
- Least Significant Bit (LSB)
- Pure Steganography
- Secret Key Steganography
Requirements
suhosin.srand.ignore = Off
suhosin.mt_srand.ignore = Off
Installation
The best way to install SteganographyKit is use composer:
Update your composer.json with:
{
"require": {
"picamator/steganographykit": "~1.0"
}
}
Usage
Encode
<?php require __DIR__ . '/vendor/autoload.php'; $stegoContainer = new Picamator\SteganographyKit\StegoContainer(); // cover-image.png|.jpg - path to existing image to cover secretText // stego-image.png - path where new stegoImage should be saved $stegoContainer->encode('/path/to/cover-image.png', '/path/to/stego-image.png', 'secret test'); // output raw image $stegoContainer->renderImage();
Decode
<?php require __DIR__ . '/vendor/autoload.php'; $stegoContainer = new Picamator\SteganographyKit\StegoContainer(); // stego-image.png $secretText = $stegoContainer->decode('/path/to/stego-image.png'); echo $secretText;
Use other stegoSystem
<?php require __DIR__ . '/vendor/autoload.php'; $stegoContainer = new Picamator\SteganographyKit\StegoContainer(); $stegoSystem = new Picamator\SteganographyKit\StegoSystem\SecretLsb(); // configure secret key $secretKey = 123456; $stegoKey = new Picamator\SteganographyKit\StegoKey\RandomKey($secretKey); $stegoSystem->setStegoKey($stegoKey); $stegoContainer->setStegoSystem($stegoSystem); // it's not necessary to set second parameter if result will put in stream $stegoContainer->encode('/path/to/cover-image.png', '', 'secret test'); // output raw image header('Content-Type: image/png'); $stegoContainer->renderImage();
Least Significant Bit (LSB)
LSB method is modified least significant bit of coverText to get stegoText. Detailed description with example can be found in [4] or in "Steganography in Depth" section [5].
SteganographyKit has implementation of LSB with such conditions:
- png or jpg images as coverText,
- text as a secretText.
Pure Steganography
Pure Steganography is a Steganography system that doesn't require prior exchange of some secret information before sending message [2].
Additionally it's possible to configurate channels that will be used in algorithm. For instance secretText can use only Red or Green and Blue or Red, Green, Blue. Moreover order in witch channels are used is important. So channels can be interpreted as Secret Key.
Note: Some researches use only Blue channel for steganography because that color is less perceived by human eye. Such conclusion is based on experiment [6]. But it should be taken critically because first of all stegoanalyze use computer technique to identify picture with hidden information, the second digital picture is displayed on a screen that has enough light.
Secret Key Steganography
For Secret Key Steganography is similar with Pure Steganography but Secret Key is used for encode-decode process [2].
SteganographyKit is used approach described in [2], accordingly them Secret Key is a seed for pseudo-random generator [8]. Such seed is used to create sequences of coordinates of coverText's pixels for covering secretText.
SteganogrpahyKit implements Secret Key Steganography with such conditions:
- SecretKey has limit: from 4 to 8 numbers. It uses as a seed for
mt_srandfunction.
Encode/Decode algorithm is differ from Pure Steganography by:
- Method of choosing pixels in CoverText. In Pure Steganography it gets one by one but in Secret Key Steganography gets accordingly pseudo-random algorithm.
- Method of use RGB channels. In Pure Steganography order is the same as user set but for Secret Key Steganography is changes accordingly pixel's coordinates.
If pixel coordinates X and Y and array of channels is ['red', 'green', 'blue'] then 'red' will have (X + Y) % 3 index in channel array the
channel that had (X + Y) % 3 would be moved to old red's place. For instance X = 4, Y = 10 them (2 + 10) % 3 = 2 then new channels array is
['blue', 'green', 'red']. So using such approach secretText will be randomly spread through coverText bits but also through channels.
Documentation
- UML class diagram: class.diagram.png
- LSB encode/decode: lsb-encode-decode.png
- Generated documentation: phpdoc, please build it following instruction
Developing
To configure developing environment please:
- Follow Docker installation steps
- Run inside Docker container
composer install
Contribution
If you find this project worth to use please add a star. Follow changes to see all activities. And if you see room for improvement, proposals please feel free to create an issue or send pull request. Here is a great guide to start contributing.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms.
License
SteganographyKit is licensed under the BSD-3-Clause License. Please see the LICENSE file for details.
References
-
Christian Cachin "Digital Steganography". IBM Research, 17 February 2005, https://www.zurich.ibm.com/~cca/papers/encyc.pdf
-
Zaidoon Kh. AL-Ani, A.A.Zaidan, B.B.Zaidan and Hamdan.O.Alanaz "Overview: Main Fundamentals for Steganography"// Journal of computing, vol. 2, issue 3, March 2010 http://arxiv.org/pdf/1003.4086.pdf
-
Sean-Philip Oriyano "Using steganography to avoid observation Hiding in plain sight." IBM Research, 02 June 2009, http://www.ibm.com/developerworks/web/library/wa-steganalysis/index.html?ca=dat
-
Vijay Kumar Sharma, Vishal Shrivastava "A steganography algorithm for hiding image in image by improved lsb substitution by minimize detection" // Journal of Theoretical and Applied Information Technology, vol. 36 issue 1, 15th February 2012 http://www.jatit.org/volumes/Vol36No1/1Vol36No1.pdf
-
Gregory Kipper "Investigator's Guide to Steganography", CRC Press, Oct 27, 2003, 240 pages http://books.google.com.ua/books?id=qGcum1ZWkiYC&pg=PA37&source=gbs_toc_r&cad=3#v=onepage&q&f=false
-
Seling Hecht, Simon Shlaer, Maurice Henri Pirenne "Energy, quanta and vision"// JGP vol.25 no. 6, 819-840, July 20, 1942 http://rieke-server.physiol.washington.edu/People/Fred/Classes/532/Hecht1942.pdf
-
Ali K. Hmood, B.B. Zaidan, A.A. Zaidan and Hamid A. Jalab "An Overview on Hidden Information Technique in Images"// Journal of Applied Science vol.10, issue 18, pages 2094-2100, 2010 http://scialert.net/abstract/?doi=jas.2010.2094.2100
-
Craig Buckler "How to Create Your Own Random Number Generator in PHP", February 8, 2012 http://www.sitepoint.com/php-random-number-generator/
picamator/steganographykit 适用场景与选型建议
picamator/steganographykit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.61k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2014 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cryptography」 「steganography」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 picamator/steganographykit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 picamator/steganographykit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 picamator/steganographykit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DUKPT implementation in PHP
Simple implementation of Steganography (Hiding a hidden message within an image)
A library for reading KeePass 2.x databases
Laravel authentication middleware for UZI passes.
A fast and dynamic Merkle tree implementation
A shared set of open-source enums for frequently used domains, helping reduce duplication and improve consistency across software projects.
统计信息
- 总下载量: 3.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-11-04