attla/pincryp

A layer of encryption a little too judicious.

Maintainers

👁 nicolau

Package info

github.com/attla/pincryp

pkg:composer/attla/pincryp

Statistics

Installs: 263

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2025-01-02 15:44 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT e3478de7d2bea18934749687bdb7a341496f9aa2

  • Nicolau <nicolau.woop@zunq.com>

laravelencryptcipherencrypterattlacripterzunq

This package is auto-updated.

Last update: 2026-06-29 01:53:47 UTC


README

👁 License
👁 Latest Stable Version
👁 Total Downloads

Installation

composer require attla/pincryp

Publish resources:

php artisan vendor:publish --provider="Attla\Pincryp\PincrypServiceProvider"

Usage

use Attla\Pincryp\Config;
use Attla\Pincryp\Factory as Pincryp;

// create config instance
$config = new Config();
$config->key = 'hic sunt dracones';
// or
$config = new Config(['key' => 'hic sunt dracones']);

// creating Pincryp instance
$pincryp = new Pincryp($config);

// encoding
$encoded = $pincryp->encode('this is something to encode..');
echo 'encoded: ' . $encoded.PHP_EOL;

$decoded = $pincryp->decode($encoded);
echo 'decoded: ' . $decoded.PHP_EOL;

The Pincryp can encrypt all primitive types: array, stdClass, object, string, integer, float, bool, and null.

See an example of array encryption:

// encoding
$encoded = $pincryp->encode([
 'name' => 'John Doe',
 'email' => 'john@example.com'
]);
echo 'encoded: ' . $encoded.PHP_EOL;

// to return a stdClass pass the second param as TRUE
$decoded = $pincryp->decode($encoded, false);
echo 'decoded: ' . $decoded.PHP_EOL;

Config params

Parameter Type Description
key String Encryption secret key
entropy Integer Entropy length to generate unique results, set zero for always the same results
seed String, Integer, Null Alphabet base seed to create a unique dictionary

License

This package is licensed under the MIT license © Zunq.