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: 125 All time: 9,440 This week: 455Up
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: 37 packages by
Country: United States United States
Age: ???
All time rank: 1173170 in United States United States
Week rank: 22 Up4 in United States United States Up
Innovation award
Innovation award
Nominee: 28x

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

  Files folder image Files (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  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 (116)  /  test  /  unit  /  tmp  
File Role Description
  Accessible without login Image file paragon_avatar.png Output used in unit testing

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:125
This week:0
All time:9,440
This week:455Up