Skip to content

marko-php/marko-encryption-openssl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marko/encryption-openssl

OpenSSL encryption driver --- encrypts and decrypts data using AES-256-GCM with authenticated encryption.

Installation

composer require marko/encryption-openssl

Requires the ext-openssl PHP extension. Automatically installs marko/encryption.

Quick Example

use Marko\Encryption\Contracts\EncryptorInterface;

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

    public function store(string $sensitiveData): string
    {
        return $this->encryptor->encrypt($sensitiveData);
    }

    public function retrieve(string $encrypted): string
    {
        return $this->encryptor->decrypt($encrypted);
    }
}

Documentation

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

About

[READ-ONLY] OpenSSL encryption driver for Marko Framework. Issues and PRs at https://github.com/marko-php/marko

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages