{"id":20790384,"url":"https://github.com/paragonie/easyrsa","last_synced_at":"2025-10-23T23:42:33.609Z","repository":{"id":52800395,"uuid":"46499970","full_name":"paragonie/EasyRSA","owner":"paragonie","description":"Simple and Secure Wrapper for phpseclib","archived":false,"fork":false,"pushed_at":"2022-05-12T04:25:11.000Z","size":39,"stargazers_count":198,"open_issues_count":4,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T13:08:49.881Z","etag":null,"topics":["cryptography-library","encryption","php","rsa","signature"],"latest_commit_sha":null,"homepage":"https://paragonie.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paragonie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2015-11-19T15:08:30.000Z","updated_at":"2025-02-11T21:32:15.000Z","dependencies_parsed_at":"2022-08-24T06:40:37.238Z","dependency_job_id":null,"html_url":"https://github.com/paragonie/EasyRSA","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2FEasyRSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2FEasyRSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2FEasyRSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2FEasyRSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragonie","download_url":"https://codeload.github.com/paragonie/EasyRSA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography-library","encryption","php","rsa","signature"],"created_at":"2024-11-17T15:34:34.945Z","updated_at":"2025-10-23T23:42:33.519Z","avatar_url":"https://github.com/paragonie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyRSA\n\n[![Build Status](https://travis-ci.org/paragonie/EasyRSA.svg?branch=master)](https://travis-ci.org/paragonie/EasyRSA)\n\nSimple and Secure Wrapper for [phpseclib](https://github.com/phpseclib/phpseclib).\n\n## Important!\n\nFor better security, you want to use [libsodium](https://pecl.php.net/package/libsodium), not EasyRSA.\n\n## Motivation\n\nAlthough the long-term security of RSA is questionable (at best) given the\nadvances in index calculus attacks, there are many issues with how RSA is\nimplemented in popular PHP cryptography libraries that make it vulnerable to\nattacks *today*.\n\nThanks to the folks who developed [phpseclib](https://github.com/phpseclib/phpseclib),\nit's possible to use secure RSA in PHP. However, it's not user-friendly enough\nfor the average PHP developer to use to its full potential. So we took it upon\nourselves to offer a user-friendly interface instead.\n\nEasyRSA is MIT licensed and brought to you by the secure PHP development team at\n[Paragon Initiative Enterprises](https://paragonie.com).\n\n## How to use this library?\n`composer require paragonie/easyrsa`\n\n### Generating RSA key pairs\n\nYou can generate 2048-bit keys (or larger) using EasyRSA. The default size is 2048.\n\n```php\n\u003c?php\nuse ParagonIE\\EasyRSA\\KeyPair;\n\n$keyPair = KeyPair::generateKeyPair(4096);\n\n$secretKey = $keyPair-\u003egetPrivateKey();\n$publicKey = $keyPair-\u003egetPublicKey();\n```\n\n#### Getting the Raw Key\n\n```php\n\u003c?php\n/** @var \\ParagonIE\\EasyRSA\\PublicKey $publicKey */\nvar_dump($publicKey-\u003egetKey());\n```\n\n### Encrypting/Decrypting a Message\n\n```php\n\u003c?php\nuse ParagonIE\\EasyRSA\\EasyRSA;\n\n$message = \"test\";\n/** @var \\ParagonIE\\EasyRSA\\PublicKey $publicKey */\n/** @var \\ParagonIE\\EasyRSA\\PrivateKey $secretKey */\n\n$ciphertext = EasyRSA::encrypt($message, $publicKey);\n\n$plaintext = EasyRSA::decrypt($ciphertext, $secretKey);\n```\n\n### Signing/Verifying a Message\n\n```php\n\u003c?php\nuse ParagonIE\\EasyRSA\\EasyRSA;\n\n$message = \"test\";\n/** @var \\ParagonIE\\EasyRSA\\PublicKey $publicKey */\n/** @var \\ParagonIE\\EasyRSA\\PrivateKey $secretKey */\n\n$signature = EasyRSA::sign($message, $secretKey);\n\nif (EasyRSA::verify($message, $signature, $publicKey)) {\n    // Signature is valid!\n}\n```\n\n## Compatibility\n\nEasyRSA is only compatible with itself. It is not compatible with OpenGPG (GnuPG, Mailvelope, etc.) You'll want [GPG-Mailer](https://github.com/paragonie/gpg-mailer) instead.\n\n## What Does it Do Under the Hood?\n\n* Encryption (KEM+DEM)\n    * Generates an random secret value\n    * Encrypts the random secret value with your RSA public key, using PHPSecLib\n      (RSAES-OAEP + MGF1-SHA256)\n    * Derives an encryption key from the secret value and its RSA-encrypted ciphertext, \n      using HMAC-SHA256.\n    * Encrypts your plaintext message using [defuse/php-encryption](https://github.com/defuse/php-encryption)\n      (authenticated symmetric-key encryption)\n    * Calculates a checksum of both encrypted values (and a version tag)\n* Authentication\n    * Signs a message using PHPSecLib (RSASS-PSS + MGF1-SHA256)\n\n## Support Contracts\n\nIf your company uses this library in their products or services, you may be\ninterested in [purchasing a support contract from Paragon Initiative Enterprises](https://paragonie.com/enterprise).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Feasyrsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagonie%2Feasyrsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Feasyrsa/lists"}