PHPackages                             jybtx/rsa-crypt-aes - 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. jybtx/rsa-crypt-aes

ActiveLibrary[Security](/categories/security)

jybtx/rsa-crypt-aes
===================

This is an extension of RSA and AES encryption and decryption for API interface, which is suitable for encryption and decryption with high requirements for encrypted data

1681PHP

Since Mar 7Pushed 1y agoCompare

[ Source](https://github.com/jybtx/rsa-crypt-aes)[ Packagist](https://packagist.org/packages/jybtx/rsa-crypt-aes)[ RSS](/packages/jybtx-rsa-crypt-aes/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

rsa-crypt-aes
=============

[](#rsa-crypt-aes)

A developing toolkit for RSA and AES encryption and decryption under test

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

[](#installation)

### Composer

[](#composer)

Execute the following command to get the latest version of the package:

```
composer require jybtx/rsa-crypt-aes

```

### Laravel

[](#laravel)

#### &gt;= laravel5.5

[](#-laravel55)

ServiceProvider will be attached automatically

#### Other

[](#other)

In your `config/app.php` add `Jybtx\RsaCryptAes\Providers\CryptServiceProvider::class` to the end of the `providers` array:

```
'providers' => [
    ...
    Jybtx\RsaCryptAes\Providers\CryptServiceProvider::class,
],
'aliases'  => [
    ...
    "RsaCryptAes" => Jybtx\RsaCryptAes\Faceds\RsaCryptAesFaced::class,
]
```

Generate secret key
-------------------

[](#generate-secret-key)

I have included a helper command to generate a key for you:

```
php artisan jybtx:secret
```

This will update your .env file with something like HEX\_IV=foobar

It is the key that will be used to sign your tokens. How that happens exactly will depend on the algorithm that you choose to use.

Publish Configuration

```
php artisan vendor:publish --provider "Jybtx\RsaCryptAes\Providers\CryptServiceProvider"
```

OR

```
php artisan vendor:publish --tag=crypt
```

Usage
-----

[](#usage)

### get a public key

[](#get-a-public-key)

```
use RsaCryptAes;
$public = RsaCryptAes::getThePublicKey();
```

### decrypt Random String

[](#decrypt-random-string)

```
$random = RsaCryptAes::decryptRandomString($obj,$md5PublicKey);
```

### decrypt Encrypted Data

[](#decrypt-encrypted-data)

```
$data = RsaCryptAes::getDecryptEncryptedData($random,$pubKeyMd5,$data);
if ( $data == FALSE ) return respone()->json(['status'=>100,'message'=>'Public key invalidation, retrieve']);
```

### return data for api

[](#return-data-for-api)

```
return RsaCryptAes::getReturnEncryptDataForApi($status,$msg,$data='');
   // Return data format
return [
    'status' => $status,
    'msg'    => $msg,
    'data'   => $data,
    'sign'   => $encrypt_aes_key,
];
```

### encrypt Data

[](#encrypt-data)

```
$restart = RsaCryptAes::getEncryptedDataAndRandomStrings($status,$msg,$data);
return [
    'status'       => $status,
    'msg'          => $msg,
    'data'         => $string,
    'random'       => $encrypt_aes_key,
    'md5public'    => md5($pubKey)
];
```

Signature operation
-------------------

[](#signature-operation)

```
$result = RsaCryptAes::getSign(string $attributes,$private_key);

return  (string) Signature;
```

Signature verification
----------------------

[](#signature-verification)

```
$result = RsaCryptAes::getVerify(string $attributes, string $sign, $publicKey);

return boolean true | false;
```

Last
----

[](#last)

Tips:The encryption and decryption of RSA and AES still need to be improved, but it does not affect the normal use

License
=======

[](#license)

MIT

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f91de8e20b269e9f418e80dde9025e1a91170abca8f15bef679b0c8e9b9a7a18?d=identicon)[jybtx](/maintainers/jybtx)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jybtx-rsa-crypt-aes/health.svg)

```
[![Health](https://phpackages.com/badges/jybtx-rsa-crypt-aes/health.svg)](https://phpackages.com/packages/jybtx-rsa-crypt-aes)
```

###  Alternatives

[mews/purifier

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

2.0k18.7M139](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25820.0k36](/packages/paragonie-ecc)

PHPackages © 2026

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