]> git.mxchange.org Git - friendica-addons.git/blob - securemail/php-gpg/README.md
492911516f414b71c165fd1b3d9cd42eded79300
[friendica-addons.git] / securemail / php-gpg / README.md
1 php-gpg
2 =======
3
4 php-gpg is a pure PHP implementation of GPG/PGP (currently supports encryption only).  The library does not require PGP/GPG binaries and should run on any platform that supports PHP.
5
6 This library is useful for encrypting data before it is sent over an insecure protocol (for example email).  Messages encrypted with this library are compatible and can be decrypted by standard GPG/PGP clients.
7
8 Features/Limitations
9 --------------------
10
11  * Supports RSA, DSA public key length of 2,4,8,16,512,1024,2048 or 4096
12  * Currently supports only encrypt
13
14 Hey You!  If you have a good understanding of public key encryption and want to implement signing or decryption your pull request would be welcome.
15  
16 Usage
17 -----
18
19 ```php
20 require_once 'libs/GPG.php';
21
22 $gpg = new GPG();
23
24 // create an instance of a GPG public key object based on ASCII key
25 $pub_key = new GPG_Public_Key($public_key_ascii);
26
27 // using the key, encrypt your plain text using the public key
28 $encrypted = $gpg->encrypt($pub_key,$plain_text_string);
29
30 echo $encrypted;
31
32 ```
33
34 License
35 -------
36
37 GPL http://www.gnu.org/copyleft/gpl.html
38
39 I'd like to release this under a more permissive license, but since PGP & GPG itself are GPL, I think this library is likely bound to the terms of GPL as well.