• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H03-May-2022-3,3561,814

examples/H03-May-2022-366244

phpc/H03-May-2022-1,057770

tests/H03-May-2022-2,8722,537

CREDITSH A D15-Dec-201620 22

HISTORY.mdH A D15-Dec-20162.1 KiB6252

LICENSEH A D15-Dec-20163.1 KiB6955

NEWS.mdH A D15-Dec-2016129 74

README.mdH A D15-Dec-20163.4 KiB12985

TODO.mdH A D15-Dec-20163.8 KiB10895

config.m4H A D03-May-20221.1 KiB3834

config.w32H A D15-Dec-2016567 2421

crypto.cH A D15-Dec-20165.9 KiB227143

crypto_base64.cH A D03-May-202212.6 KiB492358

crypto_cipher.cH A D15-Dec-201643 KiB1,5251,172

crypto_hash.cH A D15-Dec-201620.9 KiB816618

crypto_kdf.cH A D15-Dec-201613.9 KiB574407

crypto_object.cH A D15-Dec-20162.2 KiB5728

crypto_rand.cH A D15-Dec-20166.7 KiB254175

crypto_stream.cH A D15-Dec-201618.9 KiB642518

php_crypto.hH A D15-Dec-20167.8 KiB252142

php_crypto_base64.hH A D15-Dec-20162.3 KiB7228

php_crypto_cipher.hH A D15-Dec-20166.8 KiB214138

php_crypto_hash.hH A D15-Dec-20163.5 KiB12568

php_crypto_kdf.hH A D15-Dec-20162.7 KiB9645

php_crypto_object.hH A D15-Dec-20161.5 KiB376

php_crypto_rand.hH A D15-Dec-20161.8 KiB5315

php_crypto_stream.hH A D15-Dec-20162.2 KiB5518

README.md

1# PHP OpenSSL Crypto wrapper
2
3The php-crypto is an objective wrapper for OpenSSL Crypto library.
4
5
6## Installation
7
8### Linux
9
10Before starting with installation of this extensions, the `OpenSSL` library
11has to be installed. It is defaultly installed on the most Linux distributions.
12The minimal version of OpenSSL that is supported is 0.9.8 but it is recommended
13to have installed version 1.0.1+ to use all features.
14
15Of course PHP has to be installed too. The minimal version that is supported is
165.3 as the extension uses namespaces. Currently PHP also needs to be compiled
17with OpenSSL extension (`--with-openssl`). This dependency will be removed
18in the future.
19
20#### Fedora
21
22The RPM package for PHP Crypto is available in Remi's repository:
23http://rpms.famillecollet.com/
24
25It is available for Fedora, RHEL and clones (CentOS, SC and others).
26
27After downloading remi-release RPM, the package can be installed
28by executing following command:
29```
30$ sudo yum --enablerepo=remi install php-pecl-crypto
31```
32
33#### PECL
34
35This extension is available on PECL. The package is not currently stable.
36If the config `preferre_state` is stable, then the version needs to be specified.
37
38```
39$ sudo pecl install crypto-0.x.y
40```
41
42where `x` is an installed minor version number and `y` bug fixing version number.
43
44
45#### Manual Installation
46
47It's important to have a git installed as it's necessary for recursive fetch of
48[phpc](https://github.com/bukka/phpc).
49
50First clone recursively the repository
51```
52git clone --recursive https://github.com/bukka/php-crypto.git
53```
54
55Then go to the created directory and compile the extension. The PHP development
56package has to be installed (command `phpize` must be available).
57```
58cd php-crypto
59phpize
60./configure
61make
62sudo make install
63```
64
65Finally the following line needs to be added to `php.ini`
66```
67extension=crypto.so
68```
69
70Be aware that master branch contains a slightly different error handling.
71You can see examples for more details.
72
73### Windows
74
75Precompiled binary `dll` libraries for php-crypto are available
76on [the PECL crypto page](http://pecl.php.net/package/crypto).
77
78The php-crypto `dll` is also available in Jan-E Windows builds
79on [Apache Lounge](https://www.apachelounge.com/viewforum.php?f=6).
80
81
82## API
83
84The extension is still in development so the API is not stabilized yet.
85
86All classes are defined in namespace `Crypto`.
87
88Each base class has an exception class that has the same name and
89`Exception` suffix (e.g. `Hash` class has `HashException`. The exception
90classes are subclasses of the PHP `Exception` class. They define
91exception code as class constants. Each code also has a different message.
92
93The documentation is devided to sections where can be found documentation
94of all class methods, constants and other related details:
95
96- **[Base64](docs/base64.md)**
97- **[Cipher](docs/cipher.md)**
98- **[CMAC](docs/cmac.md)**
99- **[Hash](docs/hash.md)**
100- **[HMAC](docs/hmac.md)**
101- **[MAC](docs/mac.md)**
102- **[KDF](docs/kdf.md)**
103- **[PBKDF2](docs/pbkdf2.md)**
104- **[Rand](docs/rand.md)**
105- **[Streams](docs/streams.md)**
106
107
108### PHP definition for the classes
109
110The PHP based DocBlock documenation for all classes is
111generated from the extension code. It can be found in
112[docs/Crypto.php](docs/Crypto.php). It can be also
113used for an IDE autocomplete.
114
115
116## Examples
117
118The examples can be found in [the example directory](examples).
119
120
121## TODO list
122
123There is lots of features on the [TODO list](TODO.md).
124
125
126## History
127
128The release history can be found [HISTORY.md](HISTORY.md).
129