PHP Classes
elePHPant
Icontem

Halite: Perform cryptography operations with libsodium

Recommend this page to a friend!
  Info   View files Documentation   View files View files (116)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-01-14 (9 months ago) RSS 2.0 feedNot enough user ratingsTotal: 102 This week: 1All time: 8,453 This week: 1,047Up
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  
Name: Scott Arciszewski <contact>
Classes: 4 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 2x

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  
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

  Files folder image Files  /  doc  
File Role Description
Files folder imageClasses (12 files, 5 directories)
  Accessible without login Plain text file Basic.md Data Auxiliary data
  Accessible without login Plain text file Features.md Data Auxiliary data
  Accessible without login Plain text file Primitives.md Data Auxiliary data
  Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  doc  /  Classes  
File Role Description
Files folder imageAlerts (12 files)
Files folder imageAsymmetric (7 files)
Files folder imageContract (6 files)
Files folder imageStream (2 files)
Files folder imageSymmetric (5 files)
  Accessible without login Plain text file Config.md Doc. Documentation
  Accessible without login Plain text file Cookie.md Doc. Documentation
  Accessible without login Plain text file EncryptionKeyPair.md Doc. Documentation
  Accessible without login Plain text file File.md Doc. Documentation
  Accessible without login Plain text file Halite.md Doc. Documentation
  Accessible without login Plain text file Key.md Doc. Documentation
  Accessible without login Plain text file KeyFactory.md Doc. Documentation
  Accessible without login Plain text file KeyPair.md Doc. Documentation
  Accessible without login Plain text file Password.md Doc. Documentation
  Accessible without login Plain text file README.md Doc. Documentation
  Accessible without login Plain text file SignatureKeyPair.md Doc. Documentation
  Accessible without login Plain text file Util.md Doc. Documentation

  Files folder image Files  /  doc  /  Classes  /  Alerts  
File Role Description
  Accessible without login Plain text file CannotCloneKey.md Data Auxiliary data
  Accessible without login Plain text file CannotPerformOperation.md Data Auxiliary data
  Accessible without login Plain text file CannotSerializeKey.md Data Auxiliary data
  Accessible without login Plain text file ConfigDirectiveNotFound.md Data Auxiliary data
  Accessible without login Plain text file FileAccessDenied.md Data Auxiliary data
  Accessible without login Plain text file FileModified.md Data Auxiliary data
  Accessible without login Plain text file HaliteAlert.md Data Auxiliary data
  Accessible without login Plain text file InvalidDigestLength.md Data Auxiliary data
  Accessible without login Plain text file InvalidFlags.md Data Auxiliary data
  Accessible without login Plain text file InvalidKey.md Data Auxiliary data
  Accessible without login Plain text file InvalidMessage.md Data Auxiliary data
  Accessible without login Plain text file InvalidType.md Data Auxiliary data

  Files folder image Files  /  doc  /  Classes  /  Asymmetric  
File Role Description
  Accessible without login Plain text file Crypto.md Data Auxiliary data
  Accessible without login Plain text file EncryptionPublicKey.md Data Auxiliary data
  Accessible without login Plain text file EncryptionSecretKey.md Data Auxiliary data
  Accessible without login Plain text file PublicKey.md Data Auxiliary data
  Accessible without login Plain text file SecretKey.md Data Auxiliary data
  Accessible without login Plain text file SignaturePublicKey.md Data Auxiliary data
  Accessible without login Plain text file SignatureSecretKey.md Data Auxiliary data

  Files folder image Files  /  doc  /  Classes  /  Contract  
File Role Description
  Accessible without login Plain text file AsymmetricKeyCryptoInterface.md Data Auxiliary data
  Accessible without login Plain text file FileInterface.md Data Auxiliary data
  Accessible without login Plain text file KeyInterface.md Data Auxiliary data
  Accessible without login Plain text file PasswordInterface.md Data Auxiliary data
  Accessible without login Plain text file StreamInterface.md Data Auxiliary data
  Accessible without login Plain text file SymmetricKeyCryptoInterface.md Data Auxiliary data

  Files folder image Files  /  doc  /  Classes  /  Stream  
File Role Description
  Accessible without login Plain text file MutableFile.md Doc. Add docs
  Accessible without login Plain text file ReadOnlyFile.md Doc. Add docs

  Files folder image Files  /  doc  /  Classes  /  Symmetric  
File Role Description
  Accessible without login Plain text file AuthenticationKey.md Doc. Add docs
  Accessible without login Plain text file Config.md Doc. Add docs
  Accessible without login Plain text file Crypto.md Doc. Add docs
  Accessible without login Plain text file EncryptionKey.md Doc. Add docs
  Accessible without login Plain text file SecretKey.md Doc. Add docs

  Files folder image Files  /  src  
File Role Description
Files folder imageAlerts (14 files)
Files folder imageAsymmetric (7 files)
Files folder imageContract (6 files)
Files folder imageStream (2 files)
Files folder imageStructure (3 files)
Files folder imageSymmetric (5 files)
  Accessible without login Plain text file Config.php Class Class source
  Accessible without login Plain text file Cookie.php Class Class source
  Accessible without login Plain text file EncryptionKeyPair.php Class Class source
  Accessible without login Plain text file File.php Class Class source
  Accessible without login Plain text file Halite.php Class Class source
  Accessible without login Plain text file Key.php Class Class source
  Accessible without login Plain text file KeyFactory.php Class Class source
  Accessible without login Plain text file KeyPair.php Class Class source
  Accessible without login Plain text file Password.php Class Class source
  Accessible without login Plain text file SignatureKeyPair.php Class Class source
  Accessible without login Plain text file Util.php Class Class source

  Files folder image Files  /  src  /  Alerts  
File Role Description
  Accessible without login Plain text file CannotCloneKey.php Aux. Auxiliary script
  Accessible without login Plain text file CannotPerformOperation.php Aux. Auxiliary script
  Accessible without login Plain text file CannotSerializeKey.php Aux. Auxiliary script
  Accessible without login Plain text file ConfigDirectiveNotFound.php Aux. Auxiliary script
  Accessible without login Plain text file FileAccessDenied.php Aux. Auxiliary script
  Accessible without login Plain text file FileModified.php Aux. Auxiliary script
  Accessible without login Plain text file HaliteAlert.php Aux. Auxiliary script
  Accessible without login Plain text file InvalidDigestLength.php Aux. Auxiliary script
  Accessible without login Plain text file InvalidFlags.php Aux. Auxiliary script
  Accessible without login Plain text file InvalidKey.php Aux. Auxiliary script
  Accessible without login Plain text file InvalidMessage.php Aux. Auxiliary script
  Accessible without login Plain text file InvalidSalt.php Test Unit test script
  Accessible without login Plain text file InvalidSignature.php Test Unit test script
  Accessible without login Plain text file InvalidType.php Aux. Auxiliary script

  Files folder image Files  /  src  /  Asymmetric  
File Role Description
  Accessible without login Plain text file Crypto.php Class Class source
  Accessible without login Plain text file EncryptionPublicKey.php Class Class source
  Accessible without login Plain text file EncryptionSecretKey.php Class Class source
  Accessible without login Plain text file PublicKey.php Class Class source
  Accessible without login Plain text file SecretKey.php Class Class source
  Accessible without login Plain text file SignaturePublicKey.php Class Class source
  Accessible without login Plain text file SignatureSecretKey.php Class Class source

  Files folder image Files  /  src  /  Contract  
File Role Description
  Accessible without login Plain text file AsymmetricKeyCryptoInterface.php Aux. Auxiliary script
  Accessible without login Plain text file FileInterface.php Aux. Auxiliary script
  Accessible without login Plain text file KeyInterface.php Aux. Auxiliary script
  Accessible without login Plain text file PasswordInterface.php Aux. Auxiliary script
  Accessible without login Plain text file StreamInterface.php Aux. Auxiliary script
  Accessible without login Plain text file SymmetricKeyCryptoInterface.php Aux. Auxiliary script

  Files folder image Files  /  src  /  Stream  
File Role Description
  Accessible without login Plain text file MutableFile.php Class Class source
  Accessible without login Plain text file ReadOnlyFile.php Class Class source

  Files folder image Files  /  src  /  Structure  
File Role Description
  Accessible without login Plain text file BlockChain.php Test Unit test script
  Accessible without login Plain text file MerkleTree.php Test Unit test script
  Accessible without login Plain text file Node.php Test Unit test script

  Files folder image Files  /  src  /  Symmetric  
File Role Description
  Accessible without login Plain text file AuthenticationKey.php Class Class source
  Accessible without login Plain text file Config.php Class Class source
  Accessible without login Plain text file Crypto.php Class Class source
  Accessible without login Plain text file EncryptionKey.php Class Class source
  Accessible without login Plain text file SecretKey.php Class Class source

  Files folder image Files  /  test  
File Role Description
Files folder imageunit (10 files, 2 directories)
  Accessible without login Plain text file phpunit.sh Data Auxiliary data

  Files folder image Files  /  test  /  unit  
File Role Description
Files folder imageStructure (3 files)
Files folder imagetmp (1 file)
  Accessible without login Plain text file AsymmetricTest.php Test Unit test script
  Accessible without login Plain text file FileLazyTest.php Test Unit test script
  Accessible without login Plain text file FileTest.php Test Unit test script
  Accessible without login Plain text file HaliteTest.php Test Unit test script
  Accessible without login Plain text file KeyPairTest.php Test Unit test script
  Accessible without login Plain text file KeyTest.php Test Unit test script
  Accessible without login Plain text file PasswordTest.php Test Unit test script
  Accessible without login Plain text file StreamTest.php Test Unit test script
  Accessible without login Plain text file SymmetricTest.php Test Unit test script
  Accessible without login Plain text file UtilTest.php Test Unit test script

  Files folder image Files  /  test  /  unit  /  Structure  
File Role Description
  Accessible without login Plain text file BlockChainTest.php Test Unit test script
  Accessible without login Plain text file MerkleTreeTest.php Test Unit test script
  Accessible without login Plain text file NodeTest.php Test Unit test script

  Files folder image Files  /  test  /  unit  /  tmp  
File Role Description
  Accessible without login Image file paragon_avatar.png Output used in unit testing

 Version Control Unique User Downloads Download Rankings  
 100%
Total:102
This week:1
All time:8,453
This week:1,047Up