PHP Classes

Halite: Perform cryptography operations with libsodium

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 126 All time: 9,431 This week: 67Up
Version License PHP version Categories
paragonie-halite 1.0GNU General Publi...7.0.0PHP 5, Cryptography, Security
Description 

Author

This package can perform cryptography operations with libsodium. Currently it can:

- Encrypt and decrypt data with a given key
- Seal and unseal data with a given public key
- Encrypt and decrypt data with given public and private keys
- Authenticate and verify data with a given authentication key
- Sign and verify data with a given signature key

Innovation Award
PHP Programming Innovation award nominee
January 2016
Number 13
Sodium is a robust high security library for performing several types cryptography operations.

While it was somewhat inspired in NaCl library from Daniel J. Bernstein, Sodium has several advantages like being easily available on different platforms that PHP runs on.

This package implements a wrapper to execute the cryptography operations provided by libsodium using the PECL libsodium extension.

Manuel Lemos
Picture of Scott Arciszewski
  Performance   Level  
Innovation award
Innovation award
Nominee: 29x

Winner: 1x

 

Documentation

Class Documentation

* Alerts (Exceptions)

* \ParagonIE\Halite\Alerts\CannotCloneKey
* \ParagonIE\Halite\Alerts\CannotPerformOperation
* \ParagonIE\Halite\Alerts\CannotSerializeKey
* \ParagonIE\Halite\Alerts\ConfigDirectiveNotFound
* \ParagonIE\Halite\Alerts\FileAccessDenied
* \ParagonIE\Halite\Alerts\FileModified
* \ParagonIE\Halite\Alerts\HaliteAlert (Base Exception for all Alerts)
* \ParagonIE\Halite\Alerts\InvalidDigestLength
* \ParagonIE\Halite\Alerts\InvalidFlags
* \ParagonIE\Halite\Alerts\InvalidKey
* \ParagonIE\Halite\Alerts\InvalidMessage
* \ParagonIE\Halite\Alerts\InvalidType

* Asymmetric

* \ParagonIE\Halite\Asymmetric\Crypto
* \ParagonIE\Halite\Asymmetric\EncryptionPublicKey
* \ParagonIE\Halite\Asymmetric\EncryptionSecretKey
* \ParagonIE\Halite\Asymmetric\PublicKey
* \ParagonIE\Halite\Asymmetric\SecretKey
* \ParagonIE\Halite\Asymmetric\SignaturePublicKey
* \ParagonIE\Halite\Asymmetric\SignatureSecretKey

* Contract (Interfaces)

* \ParagonIE\Halite\Contract\AsymmetricKeyCryptoInterface
* \ParagonIE\Halite\Contract\CryptoInterface
* \ParagonIE\Halite\Contract\CryptoKeyInterface
* \ParagonIE\Halite\Contract\FileInterface
* \ParagonIE\Halite\Contract\PasswordInterface
* \ParagonIE\Halite\Contract\StreamInterface
* \ParagonIE\Halite\Contract\SymmetricKeyCryptoInterface

* Stream

* \ParagonIE\Halite\Stream\MutableFile
* \ParagonIE\Halite\Stream\ReadOnlyFile

* Symmetric

* \ParagonIE\Halite\Symmetric\AuthenticationKey
* \ParagonIE\Halite\Symmetric\Config
* \ParagonIE\Halite\Symmetric\Crypto
* \ParagonIE\Halite\Symmetric\EncryptionKey
* \ParagonIE\Halite\Symmetric\SecretKey

* \ParagonIE\Halite\Password * \ParagonIE\Halite\Cookie * \ParagonIE\Halite\EncryptionKeyPair * \ParagonIE\Halite\File * \ParagonIE\Halite\Halite * \ParagonIE\Halite\Key * \ParagonIE\Halite\KeyFactory * \ParagonIE\Halite\KeyPair * \ParagonIE\Halite\Password * \ParagonIE\Halite\SignatureKeyPair * \ParagonIE\Halite\Util


Details

Halite

Build Status

Halite is a high-level cryptography interface that relies on libsodium for all of its underlying cryptography operations.

Halite was created by Paragon Initiative Enterprises as a result of our continued efforts to improve the ecosystem and make cryptography in PHP safer and easier to implement.

It's released under the GPLv3 license. Commercial licenses are available from Paragon Initiative Enterprises if you wish to implement Halite in an application without making your source code available under a GPL-compatible license.

Attention: master is the Development Branch (Version 2)

See stable for version 1.x.

Using Halite in Your Applications

  1. Install Libsodium and the PHP Extension
  2. `composer require paragonie/halite`

Halite Version 2 requires PHP 7.0.0 or newer!

Using Halite in Your Project

Check out the documentation. The basic Halite API is designed for simplicity:

* Encryption

* Symmetric
   * `Symmetric\Crypto::encrypt`(`string`, EncryptionKey, `bool?`): `string`
   * `Symmetric\Crypto::decrypt`(`string`, EncryptionKey, `bool?`): `string`
* Asymmetric
   * Anonymous
     * `Asymmetric\Crypto::seal`(`string`, EncryptionPublicKey, `bool?`): `string`
     * `Asymmetric\Crypto::unseal`(`string`, EncryptionSecretKey, `bool?`): `string`
   * Authenticated
     * `Asymmetric\Crypto::encrypt`(`string`, EncryptionSecretKey, EncryptionPublicKey, `bool?`): `string`
     * `Asymmetric\Crypto::decrypt`(`string`, EncryptionSecretKey, EncryptionPublicKey, `bool?`): `string`

* Authentication

* Symmetric
   * `Symmetric\Crypto::authenticate`(`string`, AuthenticationKey, `bool?`): `string`
   * `Symmetric\Crypto::verify`(`string`, AuthenticationKey, `string`, `bool?`): `bool`
* Asymmetric
   * `Asymmetric\Crypto::sign`(`string`, SignatureSecretKey, `bool?`): `string`
   * `Asymmetric\Crypto::verify`(`string`, SignaturePublicKey, `string`, `bool?`): `bool`

  Files folder image Files (116)  
File Role Description
Files folder imagedoc (4 files, 1 directory)
Files folder imagesrc (11 files, 6 directories)
Files folder imagetest (1 file, 1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:126
This week:0
All time:9,431
This week:67Up