marko/encryption

Encryption contracts for Marko Framework

Maintainers

Package info

github.com/marko-php/marko-encryption

Type:marko-module

pkg:composer/marko/encryption

Statistics

Installs: 4

Dependents: 2

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

This package is auto-updated.

Last update: 2026-03-25 21:07:27 UTC


README

Interfaces for encryption--defines how data is encrypted and decrypted, not which cipher is used.

Installation

composer require marko/encryption

Note: You typically install a driver package (like marko/encryption-openssl) which requires this automatically.

Quick Example

use Marko\Encryption\Contracts\EncryptorInterface;

class TokenService
{
    public function __construct(
        private EncryptorInterface $encryptor,
    ) {}

    public function issueToken(array $payload): string
    {
        return $this->encryptor->encrypt(
            json_encode($payload, JSON_THROW_ON_ERROR),
        );
    }
}

Documentation

Full usage, API reference, and examples: marko/encryption