All Projects → paragonie → Easyrsa

paragonie / Easyrsa

Licence: mit
Simple and Secure Wrapper for phpseclib

Projects that are alternatives of or similar to Easyrsa

Jsrsasign
The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES JSON Web Signature/Token in pure JavaScript.
Stars: ✭ 2,760 (+1408.2%)
Mutual labels:  encryption, signature, rsa
Aes Rsa Java
AES+RSA结合应用java示例
Stars: ✭ 295 (+61.2%)
Mutual labels:  encryption, rsa
jwt-signature
[READ ONLY] Signature component of the JWT Framework
Stars: ✭ 32 (-82.51%)
Mutual labels:  encryption, signature
Jose Jwt
Ultimate Javascript Object Signing and Encryption (JOSE) and JSON Web Token (JWT) Implementation for .NET and .NET Core
Stars: ✭ 692 (+278.14%)
Mutual labels:  encryption, signature
SolRsaVerify
Solidity RSA Sha256 Pkcs1 Verification
Stars: ✭ 45 (-75.41%)
Mutual labels:  signature, rsa
fluffychat
🐑 Decentralized chat with private messages and rooms. Messages and files are encrypted using RSA
Stars: ✭ 25 (-86.34%)
Mutual labels:  encryption, rsa
Jwt Framework
JWT Framework
Stars: ✭ 577 (+215.3%)
Mutual labels:  encryption, signature
Auth Jwt
A demo to learn JWT by reverse engineering
Stars: ✭ 208 (+13.66%)
Mutual labels:  signature, rsa
Rsa Javascript
rsa-javascript
Stars: ✭ 13 (-92.9%)
Mutual labels:  encryption, rsa
Buddy Sign
High level message signing library.
Stars: ✭ 86 (-53.01%)
Mutual labels:  encryption, signature
Hybrid Crypto Js
RSA+AES hybrid encryption implementation for JavaScript. Works with Node.js, React Native and modern browsers.
Stars: ✭ 87 (-52.46%)
Mutual labels:  encryption, rsa
signature
HMAC and RSA signature for Laravel and Lumen
Stars: ✭ 26 (-85.79%)
Mutual labels:  signature, rsa
Open Crypto
🔑 Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
Stars: ✭ 115 (-37.16%)
Mutual labels:  encryption, rsa
SharpLoader
🔮 [C#] Source code randomizer and compiler
Stars: ✭ 36 (-80.33%)
Mutual labels:  encryption, signature
Encrypt
🔒 A set of high-level APIs over PointyCastle for two-way cryptography.
Stars: ✭ 199 (+8.74%)
Mutual labels:  encryption, rsa
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (+129.51%)
Mutual labels:  encryption, signature
Swiftyrsa
RSA public/private key encryption in Swift
Stars: ✭ 894 (+388.52%)
Mutual labels:  encryption, rsa
Encryptor4j
Strong encryption for Java simplified
Stars: ✭ 92 (-49.73%)
Mutual labels:  encryption, rsa
Jose2go
Golang (GO) implementation of Javascript Object Signing and Encryption specification
Stars: ✭ 150 (-18.03%)
Mutual labels:  encryption, signature
Authorizer
Authorizer is a Password Manager for Android. It emulates an HID keyboard over USB and enters your credentials on your target device. Additionally it supports OTP 🔑📴
Stars: ✭ 172 (-6.01%)
Mutual labels:  encryption

EasyRSA

Build Status

Simple and Secure Wrapper for phpseclib.

Important!

For better security, you want to use 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, 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.

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
use ParagonIE\EasyRSA\KeyPair;

$keyPair = KeyPair::generateKeyPair(4096);

$secretKey = $keyPair->getPrivateKey();
$publicKey = $keyPair->getPublicKey();

Getting the Raw Key

<?php
/** @var \ParagonIE\EasyRSA\PublicKey $publicKey */
var_dump($publicKey->getKey());

Encrypting/Decrypting a Message

<?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);

Signing/Verifying a Message

<?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!
}

Compatibility

EasyRSA is only compatible with itself. It is not compatible with OpenGPG (GnuPG, Mailvelope, etc.) You'll want GPG-Mailer instead.

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 (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)

Support Contracts

If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].