maikschneider/steganography

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

v1.0.2 2023-10-08 10:39 UTC

This package is auto-updated.

Last update: 2024-09-13 09:33:56 UTC


README

Latest Version codecov

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

要求

  • PHP8.1+

安装

composer require maikschneider/steganography

使用

将你的消息放入图像中

<?php

use MaikSchneider\Steganography\Processor;

$processor = new 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

use MaikSchneider\Steganography\Processor;

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

echo $message; // "Message to hide"

许可证

MIT许可证

作者

Kazuyuki Hayashi (@kzykhys)