naylonkessler / simple-rsa-cryptor-php
A simple toolset for working with RSA encryption in PHP
v1.0.0
2018-02-07 12:25 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: 5.7
This package is not auto-updated.
Last update: 2025-06-16 10:33:15 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