https://github.com/paragonie/easyrsa
Simple and Secure Wrapper for phpseclib
https://github.com/paragonie/easyrsa
cryptography-library encryption php rsa signature
Last synced: 7 months ago
JSON representation
Simple and Secure Wrapper for phpseclib
- Host: GitHub
- URL: https://github.com/paragonie/easyrsa
- Owner: paragonie
- License: mit
- Created: 2015-11-19T15:08:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T04:25:11.000Z (about 4 years ago)
- Last Synced: 2025-03-28T13:08:49.881Z (about 1 year ago)
- Topics: cryptography-library, encryption, php, rsa, signature
- Language: PHP
- Homepage: https://paragonie.com
- Size: 38.1 KB
- Stars: 198
- Watchers: 11
- Forks: 34
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# EasyRSA
[](https://travis-ci.org/paragonie/EasyRSA)
Simple and Secure Wrapper for [phpseclib](https://github.com/phpseclib/phpseclib).
## Important!
For better security, you want to use [libsodium](https://pecl.php.net/package/libsodium), not EasyRSA.
## 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?
`composer require paragonie/easyrsa`
### Generating RSA key pairs
You can generate 2048-bit keys (or larger) using EasyRSA. The default size is 2048.
```php
getPrivateKey();
$publicKey = $keyPair->getPublicKey();
```
#### Getting the Raw Key
```php
getKey());
```
### Encrypting/Decrypting a Message
```php