PHPackages                             ssitu/spirit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. ssitu/spirit

ActiveLibrary[Security](/categories/security)

ssitu/spirit
============

Spirit Printer; steganography for 0 cents a copy!

v1.0.0(5y ago)03MITPHP

Since Jun 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/I-is-as-I-does/Spirit)[ Packagist](https://packagist.org/packages/ssitu/spirit)[ Docs](https://github.com/I-is-as-I-does/Spirit)[ RSS](/packages/ssitu-spirit/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Spirit
======

[](#spirit)

Spirit Printer; steganography for 0 cents a copy!

Getting started
---------------

[](#getting-started)

```
$ composer require ssitu/spirit
```

Also requires Gd library enabled.

How to
------

[](#how-to)

Demo available in `samples/`.

```
use SSITU\Spirit\Spirit;
use SSITU\Sod\Sod;

require_once '/path/to/vendor/autoload.php';

// Sod config:
$sodConfig["cryptKey"] = '703af4dd03ebe11e35167157a8a697d8a2cb545a907a38289f8a7ba19432a342';
$sodConfig["flavour"] = "Sugar"; # prefer "Sodium" if installed

// Sod init:
$Sod = new Sod($sodConfig);

// Spirit init:
$Spirit = new Spirit($Sod);

//You can also pass Sod like so:
# $Spirit->setSod($Sod);

// Print config (could also be a decoded json file, cf. samples/):
$printConfig = [
  'keyLength' => 32,
  'width' => 286,
  'height' => 186,
  'margin' => 9,
  'minfillerLen' => 32,
  'imgExtension' => 'png',
  'printTexts' => true,
  'headerText' => 'PASS',
  'footerText' => 'www.some-domain.com/login',
  'mainText' => 'Bob',
  'addtTexts' => ['guest of Ida'],
  'fontFilePath' => '../samples/sourcessproxtrlight.ttf',
  'textColorCodes' => [160,160,160],
  'fontSize' => 11,
  'angle' => 0,
  'lineSpacer' => 2,
  'adtlines' => 4,
  'bgImgPath' => '../samples/baseImg.png',
  'useBgImg' => false,
  'bgColorCodes' => [255,255,255],
  'drawFrame' => true,
  'lineColorCodes' => [160, 160,160,],
];

// Some data to inject (must be a string):
$dataToInject = 'such Secret much Hidden wow';

// Printing image:
// returns an array with 'image' (b64 format) and 'key'
$printRslt = $Spirit->printImg($dataToInject, $printConfig);

// Reading image (either a filepath, or a b64 image can be passed)
// returns decoded data
$Spirit->readImg($printRslt['image'], $printRslt['key']);

// If providing a key: it must consist of b64 characters only;
// and length must match with the one specified in config
$givenKey = 'Hf/mRnoh3mJDl8w+7DuhelTdHIWuj4V4';
$printRslt = $Spirit->printImg($dataToInject, $printConfig, $givenKey);

// Reading previously stored image
$safelyStoredSpiritKey = 'nCLz32iG2hyu67lWCKBSFHeZw2qh1cFx';
$Spirit->readImg('../samples/spirit-image.png', $safelyStoredSpiritKey);

// If something went wrong:
$Spirit->getLogs();
```

Doc
---

[](#doc)

[![Spirit Duplicator](Spirit.jpg)](Spirit.jpg)

Please note that Spirit has NOT been extensively tested; therefore, consider it a toy.

SSITU/Sod, or another encryption util – as long as it implements the same interface, is REQUIRED to run Spirit.

Spirit MUST NOT be used to store sensitive data.
Permanent data loss WILL occurs, AT LEAST in those scenarii:

- if either Spirit or Sod key gets lost or corrupted, even partially;
- if a run-time or an encryption error occurs;
- if libraries are no longer properly maintained.

Both specified Sod key AND provided Spirit key are REQUIRED for future decryption;
Spirit key is only given ONCE, on successful image creation;
thus, Sod key and Spirit key MUST be stored in a safe place.
Spirit key SHOULD NOT be displayed publicly;
Sod key MUST NOT be displayed publicly.

A Spirit image can be duplicated and renamed at will;
However, a Spirit image MUST NOT be edited, compressed, resized, or saved in another format.

Contributing
------------

[](#contributing)

Sure! You can take a loot at [CONTRIBUTING](CONTRIBUTING.md).

License
-------

[](#license)

This project is under the MIT License; cf. [LICENSE](LICENSE) for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1837d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0abf823fded25a054764d7b7106a69b4281ff506994ffe2fea00d8a9296e715a?d=identicon)[I-is-as-I-does](/maintainers/I-is-as-I-does)

---

Top Contributors

[![I-is-as-I-does](https://avatars.githubusercontent.com/u/66915011?v=4)](https://github.com/I-is-as-I-does "I-is-as-I-does (11 commits)")

---

Tags

encryptiongdphpsteganographyphpsteganography

### Embed Badge

![Health badge](/badges/ssitu-spirit/health.svg)

```
[![Health](https://phpackages.com/badges/ssitu-spirit/health.svg)](https://phpackages.com/packages/ssitu-spirit)
```

###  Alternatives

[stymiee/php-simple-encryption

The PHP Simple Encryption library is designed to simplify the process of encrypting and decrypting data while ensuring best practices are followed. By default is uses a secure encryption algorithm and generates a cryptologically strong initialization vector so developers do not need to becomes experts in encryption to securely store sensitive data.

449.2k](/packages/stymiee-php-simple-encryption)[ukrbublik/openssl_x509_crl

Missing OpenSSL function on PHP to create CRL (certificate revocation list) for CA

182.1k](/packages/ukrbublik-openssl-x509-crl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
