https://github.com/web-of-trust/php-privacy
PHP Privacy - The OpenPGP library in PHP language
https://github.com/web-of-trust/php-privacy
cryptography encryption openpgp privacy-guard rfc4880 rfc6637 rfc9580 signing
Last synced: 3 months ago
JSON representation
PHP Privacy - The OpenPGP library in PHP language
- Host: GitHub
- URL: https://github.com/web-of-trust/php-privacy
- Owner: web-of-trust
- License: bsd-3-clause
- Created: 2023-04-28T09:53:15.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2026-01-20T10:46:02.000Z (4 months ago)
- Last Synced: 2026-01-20T19:48:18.895Z (4 months ago)
- Topics: cryptography, encryption, openpgp, privacy-guard, rfc4880, rfc6637, rfc9580, signing
- Language: PHP
- Homepage:
- Size: 2.7 MB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
PHP Privacy - The OpenPGP library in PHP language
=================================================
PHP Privacy is an implementation of the OpenPGP standard in PHP language.
It implements [RFC 9580](https://www.rfc-editor.org/rfc/rfc9580) and
provides encryption with public key or symmetric cryptographic algorithms,
digital signatures, compression, and key management.
## Requirement
* PHP 8.1.x or later,
* [phpseclib](https://github.com/phpseclib/phpseclib) library provides cryptography algorithms,
* [Argon2](https://github.com/P-H-C/phc-winner-argon2) for Argon2 string-to-key,
* (optional) PHPUnit to run tests,
## Features
* Support data signing & encryption.
* Support key management: key generation, key reading, key decryption.
* Support public-key algorithms: [RSA](https://www.rfc-editor.org/rfc/rfc3447),
[ECDSA](https://www.rfc-editor.org/rfc/rfc6979),
[EdDSA](https://www.rfc-editor.org/rfc/rfc8032)
and [ECDH](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman).
* Support symmetric ciphers: Blowfish, Twofish,
[AES](https://www.rfc-editor.org/rfc/rfc3394),
[Camellia](https://www.rfc-editor.org/rfc/rfc3713).
* Support AEAD ciphers: [EAX](https://seclab.cs.ucdavis.edu/papers/eax.pdf),
[OCB](https://tools.ietf.org/html/rfc7253),
[GCM](https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-38d.pdf).
* Support hash algorithms: SHA-256, SHA-384, SHA-512, SHA-224, SHA3-256, SHA3-512.
* Support compression algorithms: Zip, Zlib, BZip2.
* Support [ECC](https://en.wikipedia.org/wiki/Elliptic-curve_cryptography) curves:
[secp256r1, secp384r1, secp521r1](https://www.rfc-editor.org/rfc/rfc6090),
[brainpoolP256r1, brainpoolP384r1, brainpoolP512r1](https://www.rfc-editor.org/rfc/rfc5639),
[Curve25519, Curve448](https://www.rfc-editor.org/rfc/rfc7748),
[Ed25519, Ed448](https://www.rfc-editor.org/rfc/rfc8032).
* Support public-key algorithms, symmetric ciphers & hash algorithms
for signature verification & message decryption (backward compatibility):
DSA, ElGamal, TripleDES, IDEA, CAST5, MD5, SHA-1, RIPEMD-160.
## Installation
Via [Composer](https://getcomposer.org)
```bash
$ composer require php-privacy/openpgp
```
or just add it to your `composer.json` file directly.
```javascript
{
"require": {
"php-privacy/openpgp": "^2.1"
}
}
```
## Basic usage of PHP Privacy
Sign and verify cleartext message
```php
sign([$privateKey]);
$verifications = $signedMessage->verify([$publicKey]);
```
## Licensing
[BSD 3-Clause](LICENSE)
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.