PHPackages                             hubxlabs/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. hubxlabs/easyrsa

ActiveLibrary[Security](/categories/security)

hubxlabs/easyrsa
================

Simple and secure asymmetric encryption powered by PHPSecLib

0.6.2(7y ago)06.9kMITPHP

Since Nov 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/hubxlabs/EasyRSAX)[ Packagist](https://packagist.org/packages/hubxlabs/easyrsa)[ RSS](/packages/hubxlabs-easyrsa/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (10)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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.2% 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 ~140 days

Recently: every ~171 days

Total

9

Last Release

2705d ago

### Community

---

Top Contributors

[![paragonie-security](https://avatars.githubusercontent.com/u/15914520?v=4)](https://github.com/paragonie-security "paragonie-security (23 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (3 commits)")[![codermarcel](https://avatars.githubusercontent.com/u/12887835?v=4)](https://github.com/codermarcel "codermarcel (2 commits)")[![ivanciger](https://avatars.githubusercontent.com/u/7526651?v=4)](https://github.com/ivanciger "ivanciger (2 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (1 commits)")

### Embed Badge

![Health badge](/badges/hubxlabs-easyrsa/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M212](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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