Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 53 | All time: 10,652 This week: 35![]() |
Version | License | PHP version | Categories | |||
easyrsa 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, Cryptography |
Description | Author | |
This package implements RSA data encryption and decryption using phpseclib. |
|
Simple and Secure Wrapper for phpseclib.
For better security, you want to use libsodium, not EasyRSA.
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, 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.
composer require paragonie/easyrsa
You can generate 2048-bit keys (or larger) using EasyRSA. The default size is 2048.
<?php
use ParagonIE\EasyRSA\KeyPair;
$keyPair = KeyPair::generateKeyPair(4096);
$secretKey = $keyPair->getPrivateKey();
$publicKey = $keyPair->getPublicKey();
<?php
/ @var \ParagonIE\EasyRSA\PublicKey $publicKey */
var_dump($publicKey->getKey());
<?php
use ParagonIE\EasyRSA\EasyRSA;
$message = "test";
/ @var \ParagonIE\EasyRSA\PublicKey $publicKey */
/ @var \ParagonIE\EasyRSA\PrivateKey $secretKey */
$ciphertext = EasyRSA::encrypt($message, $publicKey);
$plaintext = EasyRSA::decrypt($ciphertext, $secretKey);
<?php
use ParagonIE\EasyRSA\EasyRSA;
$message = "test";
/ @var \ParagonIE\EasyRSA\PublicKey $publicKey */
/ @var \ParagonIE\EasyRSA\PrivateKey $secretKey */
$signature = EasyRSA::sign($message, $secretKey);
if (EasyRSA::verify($message, $signature, $publicKey)) {
// Signature is valid!
}
EasyRSA is only compatible with itself. It is not compatible with OpenGPG (GnuPG, Mailvelope, etc.) You'll want GPG-Mailer instead.
If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Read me | ||
![]() ![]() |
Data | Auxiliary data |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.