PHPackages                             php-privacy/openpgp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. php-privacy/openpgp

ActiveLibrary[Security](/categories/security)

php-privacy/openpgp
===================

PHP Privacy - The OpenPGP library in PHP language

2.2.7(1mo ago)521.6k↑21.7%7BSD-3-ClausePHPPHP &gt;=8.1CI passing

Since Jun 6Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/web-of-trust/php-privacy)[ Packagist](https://packagist.org/packages/php-privacy/openpgp)[ RSS](/packages/php-privacy-openpgp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (49)Used By (0)

PHP Privacy - The OpenPGP library in PHP language
=================================================

[](#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
-----------

[](#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
--------

[](#features)

- Support data signing &amp; 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 &amp; hash algorithms for signature verification &amp; message decryption (backward compatibility): DSA, ElGamal, TripleDES, IDEA, CAST5, MD5, SHA-1, RIPEMD-160.

Installation
------------

[](#installation)

Via [Composer](https://getcomposer.org)

```
$ composer require php-privacy/openpgp
```

or just add it to your `composer.json` file directly.

```
{
    "require": {
        "php-privacy/openpgp": "^2.1"
    }
}
```

Basic usage of PHP Privacy
--------------------------

[](#basic-usage-of-php-privacy)

Sign and verify cleartext message

```
