dataground / simplepgp
Pure PHP simple PGP decryption
0.2.2
2025-02-11 10:20 UTC
Requires
- singpolyma/openpgp-php: ^0.7
This package is auto-updated.
Last update: 2025-02-11 10:21:24 UTC
README
Very simple library for PGP decryption using the excellent (but rather complex) Singpoyma OpenPGP Library. A lot of people have problems with the complexity of GnuPG/OpenPGP/PGP decryption in automated workflows. SimplePGP tries to solve this problem, it can decrypt data without any dependencies and without the need to add the private key to any local keyring.
Installation
composer install dataground/simplepgp
Input formats
- The PrivateKey file should be ascii armored (default for most key export tools)
- The input file content should be in base64 encoded format (not binary)
Example
$spgp = new SimplePgp(); $decrypted = $spgp->decrypt( file_get_contents('/path/to/my_encrypted_file'), file_get_contents('/path/to/my_privatekey_file'), 'myVerySecretKeyPassPhrase' );
TODO
- Add encryption support
- Improve error handling
- Add tests and examples
Contributing
Contributions are very welcome, please adhere to [http://www.phptherightway.com/] best practices.