PHPackages                             dmamontov/rsacrypt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. dmamontov/rsacrypt

ActiveLibrary[Security](/categories/security)

dmamontov/rsacrypt
==================

Data encryption using public and private keys.

1.1.0(3y ago)29252BSD-3-ClausePHPPHP &gt;=5.3.3

Since May 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dmamontov/rsacrypt)[ Packagist](https://packagist.org/packages/dmamontov/rsacrypt)[ Docs](http://www.slobel.ru/)[ RSS](/packages/dmamontov-rsacrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/2ac1b0ee680f088b571cf5373d3fddc1166789e8e23a2ff8ab4f5409396e7442/68747470733a2f2f7472617669732d63692e6f72672f646d616d6f6e746f762f72736163727970742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dmamontov/rsacrypt)[![Latest Stable Version](https://camo.githubusercontent.com/ff57b803ad1ed6e24a85e93e1f05aef48dbedaa3ae0b7e407a1150eac2068be6/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f72736163727970742f762f737461626c652e737667)](https://packagist.org/packages/dmamontov/rsacrypt)[![License](https://camo.githubusercontent.com/356c4c1e1b5e457f50d1795885a1a4069e6d0779c5f81fc46a040b8da436b19d/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f72736163727970742f6c6963656e73652e737667)](https://packagist.org/packages/dmamontov/rsacrypt)[![Total Downloads](https://camo.githubusercontent.com/c5321f1eae5659246074cf61ccd2df7ffd5338a3cf20a401347efed9171d3046/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f72736163727970742f646f776e6c6f616473)](https://packagist.org/packages/dmamontov/rsacrypt)[![PHP Classes](https://camo.githubusercontent.com/8b4a94a79f43f44687b40e0a91a226a5b6d929b69cba415d01253b2343065bf0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d636c61737365732d626c75652e737667)](http://www.phpclasses.org/package/9206-PHP-Generate-RSA-keys-and-encrypt-data-using-OpenSSL.html)

RSA Crypt
=========

[](#rsa-crypt)

This class can RSA generate keys and encrypt data using OpenSSL.

It can generate public and private RSA keys of given length calling the openssl program.

The class and also encrypt data with a given public key file and decrypt data with a given private key file.

[More information](http://dmamontov.github.io/rsacrypt)

Requirements
------------

[](#requirements)

- PHP version ~5.3.3

Installation
------------

[](#installation)

1. Install [composer](https://getcomposer.org/download/)
2. Follow in the project folder:

```
composer require dmamontov/rsacrypt ~1.0.2
```

In config `composer.json` your project will be added to the library `dmamontov/rsacrypt`, who settled in the folder `vendor/`. In the absence of a config file or folder with vendors they will be created.

If before your project is not used `composer`, connect the startup file vendors. To do this, enter the code in the project:

```
require 'path/to/vendor/autoload.php';
```

### Example of work

[](#example-of-work)

```
$crypt = new RsaCrypt;

$crypt->genKeys(2048);
$crypt->setPublicKey('public.pem');
$crypt->setPrivateKey('private.pem');
$data = $crypt->encrypt("Test Crypt");

echo $data;
echo $crypt->decrypt($data);
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~871 days

Total

4

Last Release

1392d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.0.2PHP &gt;=5.3.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5955726?v=4)[Dmitry Mamontov](/maintainers/dmamontov)[@dmamontov](https://github.com/dmamontov)

---

Top Contributors

[![dmamontov](https://avatars.githubusercontent.com/u/5955726?v=4)](https://github.com/dmamontov "dmamontov (19 commits)")

---

Tags

dataopensslcryptprivatepublic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmamontov-rsacrypt/health.svg)

```
[![Health](https://phpackages.com/badges/dmamontov-rsacrypt/health.svg)](https://phpackages.com/packages/dmamontov-rsacrypt)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104101.1k1](/packages/vlucas-pikirasa)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5275.0k30](/packages/ionux-phactor)[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

961.0M2](/packages/nzo-url-encryptor-bundle)[mmeyer2k/dcrypt

A petite library of encryption functionality for PHP

98727.2k1](/packages/mmeyer2k-dcrypt)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
