naylonkessler/simple-rsa-cryptor-php

A simple toolset for working with RSA encryption in PHP

Installs: 54

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/naylonkessler/simple-rsa-cryptor-php

v1.0.0 2018-02-07 12:25 UTC

This package is not auto-updated.

Last update: 2025-12-15 12:50:10 UTC


README

A simple toolset for working with RSA encryption in PHP.

Installation

Just require the package using composer.

composer require naylonkessler/simple-rsa-cryptor-php

Using the package

Just import, instantiate and call:

<?php

use SimpleRSACryptor\Cryptor;
use SimpleRSACryptor\Keys\PublicKey;
use SimpleRSACryptor\Keys\PrivateKey;

$publicKey = new PublicKey('path-to-public-key-file.pem');
$privateKey = new PrivateKey('path-to-private-key-file.pem');
$passPhrase = 'pass phrase of private key';

$cryptor = new Cryptor($publicKey, $privateKey, $passPhrase);
$encrypted = $cryptor->encrypt('Some data');
$decrypted = $cryptor->decrypt($encrypted);

echo $decrypted;

The \SimpleRSACryptor\Cryptor class

TBD

The \SimpleRSACryptor\Keys\PublicKey class

TBD

The \SimpleRSACryptor\Keys\PrivateKey class

TBD