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

1670PHP

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 yesterday

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 10% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

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

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/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.7M113](/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)
