wboyz/steganography

隐写术的简单实现(在图像中隐藏隐藏消息)

dev-master 2020-11-11 11:00 UTC

This package is auto-updated.

Last update: 2024-09-11 19:20:45 UTC


README

Latest Unstable Version Build Status Coverage Status SensioLabsInsight

隐写术的简单PHP实现(在图像中隐藏隐藏消息)

要求

  • PHP5.4+

安装

更新你的 composer.json 并运行 composer update

{
    "require": {
        "kzykhys/steganography": "dev-master"
    }
}

用法

将你的消息放入图像中

<?php

require __DIR__ . '/vendor/autoload.php';

$processor = new KzykHys\Steganography\Processor();
$image = $processor->encode('/path/to/image.jpg', 'Message to hide'); // jpg|png|gif

// Save image to file
$image->write('/path/to/image.png'); // png only

// Or outout image to stdout
$image->render();

从图像中提取消息

<?php

require __DIR__ . '/vendor/autoload.php';

$processor = new KzykHys\Steganography\Processor();
$message = $processor->decode('/path/to/image.png');

echo $message; // "Message to hide"

许可

MIT 许可证

作者

Kazuyuki Hayashi (@kzykhys)