PHPackages                             unity-magento-git-hub-user/easyrsa - 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. unity-magento-git-hub-user/easyrsa

ActiveLibrary[Security](/categories/security)

unity-magento-git-hub-user/easyrsa
==================================

Simple and secure asymmetric encryption powered by PHPSecLib

1.0.1(9y ago)0156MITPHP

Since Jun 30Pushed 9y agoCompare

[ Source](https://github.com/UnityMagentoGitHubUser/EasyRSA)[ Packagist](https://packagist.org/packages/unity-magento-git-hub-user/easyrsa)[ RSS](/packages/unity-magento-git-hub-user-easyrsa/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

EasyRSA
=======

[](#easyrsa)

[![Build Status](https://camo.githubusercontent.com/555be38dde72146aa0c57e51aca4f2a96888773cc87c7f23366629e3e6759dd9/68747470733a2f2f7472617669732d63692e6f72672f70617261676f6e69652f456173795253412e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/paragonie/EasyRSA)

Simple and Secure Wrapper for [phpseclib](https://github.com/phpseclib/phpseclib).

Important!
----------

[](#important)

For better security, you want to use [libsodium](https://pecl.php.net/package/libsodium), not EasyRSA.

Motivation
----------

[](#motivation)

Although the long-term security of RSA is questionable (at best) given the advances in index calculus attacks, there are many issues with how RSA is implemented in popular PHP cryptography libraries that make it vulnerable to attacks *today*.

Thanks to the folks who developed [phpseclib](https://github.com/phpseclib/phpseclib), it's possible to use secure RSA in PHP. However, it's not user-friendly enough for the average PHP developer to use to its full potential. So we took it upon ourselves to offer a user-friendly interface instead.

EasyRSA is MIT licensed and brought to you by the secure PHP development team at [Paragon Initiative Enterprises](https://paragonie.com).

How to use this library?
------------------------

[](#how-to-use-this-library)

`composer require paragonie/easyrsa`

### Generating RSA key pairs

[](#generating-rsa-key-pairs)

You can generate 2048-bit keys (or larger) using EasyRSA. The default size is 2048.

```
use \ParagonIE\EasyRSA\KeyPair;

$keyPair = KeyPair::generateKeyPair(4096);

$secretKey = $keyPair->getPrivateKey();
$publicKey = $keyPair->getPublicKey();
```

### Encrypting/Decrypting a Message

[](#encryptingdecrypting-a-message)

```
use \ParagonIE\EasyRSA\EasyRSA;

$ciphertext = EasyRSA::encrypt($message, $publicKey);

$plaintext = EasyRSA::decrypt($ciphertext, $secretKey);
```

### Signing/Verifying a Message

[](#signingverifying-a-message)

```
use \ParagonIE\EasyRSA\EasyRSA;

$signature = EasyRSA::sign($message, $secretKey);

if (EasyRSA::verify($message, $signature, $publicKey)) {
    // Signature is valid!
}
```

What Does it Do Under the Hood?
-------------------------------

[](#what-does-it-do-under-the-hood)

- Encryption (KEM+DEM)
    - Generates an random secret value
    - Encrypts the random secret value with your RSA public key, using PHPSecLib (RSAES-OAEP + MGF1-SHA256)
    - Derives an encryption key from the secret value and its RSA-encrypted ciphertext, using HMAC-SHA256.
    - Encrypts your plaintext message using [defuse/php-encryption](https://github.com/defuse/php-encryption)(authenticated symmetric-key encryption)
    - Calculates a checksum of both encrypted values (and a version tag)
- Authentication
    - Signs a message using PHPSecLib (RSASS-PSS + MGF1-SHA256)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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 ~0 days

Total

2

Last Release

3287d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c95e466d6d30f6bd43b41fc7c18b7cbdb7f0a0ae063fe80dde350b9079f86f?d=identicon)[UnityMagentoPackagistUser](/maintainers/UnityMagentoPackagistUser)

---

Top Contributors

[![UnityMagentoGitHubUser](https://avatars.githubusercontent.com/u/29795062?v=4)](https://github.com/UnityMagentoGitHubUser "UnityMagentoGitHubUser (1 commits)")

---

Tags

cryptographyrsapublic keyasymmetric

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unity-magento-git-hub-user-easyrsa/health.svg)

```
[![Health](https://phpackages.com/badges/unity-magento-git-hub-user-easyrsa/health.svg)](https://phpackages.com/packages/unity-magento-git-hub-user-easyrsa)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k455.2M1.5k](/packages/phpseclib-phpseclib)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4671.3M23](/packages/paragonie-ciphersweet)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104104.1k1](/packages/vlucas-pikirasa)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3074.2k2](/packages/miladrahimi-phpcrypt)[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.

5283.3k30](/packages/ionux-phactor)[asymmetricrypt/asymmetricrypt

A simple PHP public key cryptography library

104.3k](/packages/asymmetricrypt-asymmetricrypt)

PHPackages © 2026

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