PackageTrack
Sign in Get early access

paragonie/halite

High-level cryptography interface powered by libsodium

v5.1.4 11M downloads/mo #1151 most downloaded on Packagist paragonie/halite

What this package is like to depend on

Last release 11 months ago

19 Sep 2025

Release timing varies

gaps range from 3 weeks to 1.9 years

Some releases are documented

notes for 36 of 64 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

64 releases · first in 2015

1 release in the last 12 months

see the full history below

Release timeline

64 releases · Sep 2015 to Sep 2025
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 64
  1. v5.1.4 19 Sep 2025
    Release notes
    Open source →
    Release notes
    • Add PHPStan analysis, level 5 by @spaze in https://github.com/paragonie/halite/pull/195
    • Replace all http:// links with the https:// URL they redirect to by @GrahamCampbell in https://github.com/paragonie/halite/pull/196
    • Use Psalm 6 by @spaze in https://github.com/paragonie/halite/pull/198
    • Remove access modifier final from private methods by @junaidbinfarooq in https://github.com/paragonie/halite/pull/204
    • Ignore tests, workflows and .MD docs with "export-ignore" on .gitattr… by @erikn69 in https://github.com/paragonie/halite/pull/205
    • Expand test coverage by @paragonie-security in https://github.com/paragonie/halite/pull/206
    • Fixed the broken test coverage badge (https://github.com/paragonie/halite/pull/207 and https://github.com/paragonie/halite/pull/208)
    Open source →
  2. v5.1.3 23 Jan 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v5.1.2...v5.1.3

    Open source →
    Release notes
    • Merged #184, which fixes PHP 8.4 deprecations with nullable types.
    Open source →
  3. v5.1.2 08 May 2024
    Release notes
    • Use #[SensitiveParameter] annotation on some inputs
      • This is defense in depth; we already wrapped most in HiddenString
    • Updated dependencies
    Open source →
    Release notes
    • Use #[SensitiveParameter] annotation on some inputs
      • This is defense in depth; we already wrapped most in HiddenString
    • Updated dependencies
    Open source →
  4. v5.1.1 19 Apr 2024
    Release notes
    Open source →
    Release notes
    Open source →
  5. v5.1.0 23 May 2022
    Release notes
    • Dropped PHP 8.0 support, increased minimum PHP version to 8.1.
      • This is due to the significant performance difference between ext/sodium
        and sodium_compat, and the functions we use in 5.x aren't available until
        PHP 8.1. See #178.
    • The 5.0.x branch will continue to function on PHP 8.0 but performance is
      not guaranteed.
    Open source →
    Release notes
    • Dropped PHP 8.0 support, increased minimum PHP version to 8.1.
      • This is due to the significant performance difference between ext/sodium and sodium_compat, and the functions we use in 5.x aren't available until PHP 8.1. See #178.
    • The 5.0.x branch will continue to function on PHP 8.0 but performance is not guaranteed.
    Open source →
  6. v5.0.0 19 Jan 2022
    Release notes
    • Increased minimum PHP version to 8.0.
    • Security: Asymmetric encryption now uses HKDF-BLAKE2b to extract a 256-bit uniformly random bit string for the encryption key, rather than using the raw X25519 output directly as an encryption key. This is important because Elliptic Curve Diffie-Hellman results in a random group element, but that isn't necessarily a uniformly random bit string.
      • Because Halite v4 and earlier did not perform this step, it's superficially susceptible to Cheon's attack. This reduces the effective security from 125 bits (Pollard's rho) to 123 bits, but neither is a practical concern today.
    • Security: Halite v5 uses the PAE strategy from PASETO to prevent canonicalization attacks.
    • Security: Halite v5 appends the random salt to HKDF's info parameter instead of the salt parameter. This allows us to meet the KDF Security Definition (which is stronger than a mere Pseudo-Random Function).
    • Encryption now uses XChaCha20 instead of XSalsa20.
    • The File class no longer supports the resource type. To migrate code, wrap your resource arguments in a ReadOnlyFile or MutableFile object.
    • Added File::asymmetricEncrypt() and File::asymmetricDecrypt().

    These security improvements were identified through an internal code review after years of studying new cryptographic attacks. Halite v4 ciphertexts are still decryptable with v5, so upgrading should be largely drop-in.

    Open source →
    Release notes
    • Increased minimum PHP version to 8.0.
    • Security: Asymmetric encryption now uses HKDF-BLAKE2b to extract a 256-bit uniformly random bit string for the encryption key, rather than using the raw X25519 output directly as an encryption key. This is important because Elliptic Curve Diffie-Hellman results in a random group element, but that isn't necessarily a uniformly random bit string.
      • Because Halite v4 and earlier did not perform this step, it's superficially susceptible to Cheon's attack. This reduces the effective security from 125 bits (Pollard's rho) to 123 bits, but neither is a practical concern today.
    • Security: Halite v5 uses the PAE strategy from PASETO to prevent canonicalization attacks.
    • Security: Halite v5 appends the random salt to HKDF's info parameter instead of the salt parameter. This allows us to meet the KDF Security Definition (which is stronger than a mere Pseudo-Random Function).
    • Encryption now uses XChaCha20 instead of XSalsa20.
    • The File class no longer supports the resource type. To migrate code, wrap your resource arguments in a ReadOnlyFile or MutableFile object.
    • Added File::asymmetricEncrypt() and File::asymmetricDecrypt().
    Open source →
  7. v4.9.0 15 Jul 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v4.8.0...v4.9.0

    Open source →
  8. v4.8.0 18 Apr 2021
    Release notes
    • Merged #158, which removes the final access modifier from private methods and guarantees PHP 8 support.
    • Migrated tests off of Travis CI, onto Github Actions instead.
    Open source →
    Release notes
    • Merged #158, which removes the final access modifier from private methods and guarantees PHP 8 support.
    • Migrated tests off of Travis CI, onto Github Actions instead.
    Open source →
  9. v4.7.1 06 Dec 2020
    Release notes
    • Allows hidden-string v1 or v2 to be installed.
    Open source →
    Release notes
    • Allow v2 of paragonie/hidden-string to be installed.
    Open source →
  10. v4.7.0 03 Dec 2020
    Release notes
    • Merged #154, which supports the SameSite cookie arguments on PHP 7.3+.
    • Create a wrapper for sodium_memzero() to support sodium_compat.
    • Added support for PHP 8.
    • #146, #155, #156 -- Various documentation improvements.
    Open source →
    Release notes
    • Merged #154, which supports the SameSite cookie arguments on PHP 7.3+.
    • Create a wrapper for sodium_memzero() to support sodium_compat.
    • Added support for PHP 8.
    • #146, #155, #156 -- Various documentation improvements.
    Open source →
  11. v4.6.0 12 Sep 2019
    Release notes
    • Merged #138, which adds remote stream support to ReadOnlyFile.
    • Merged #140, which saves some overhead on hash recalculation.
    • Merged #136 and #137, which updated the sodium stub files. These aren't strictly necessary anymore; with the adoption of libsodium in PHP 7.2 and sodium_compat, most IDEs autocomplete correctly. But fixing nits is always appreciated.
    • Update minimum sodium_compat to v1.11.0.
    Open source →
  12. v4.5.4 05 Jun 2019
    Release notes
    • Merged #132, which ensures all Halite exceptions implement Throwable.
    • Merged #133, which updates the documentation for the File API. Thanks @elliot-sawyer.
    • Merged #134, which allows MutableFile to be used on resources opened in wb mode. Thanks @christiaanbaartse.
    • Other minor documentation improvements.
    Open source →
  13. v4.5.3 11 Mar 2019
    Release notes
    • Fixed some minor nuisances with Psalm and PHPUnit.
    • Added reference to Halite-Legacy to the README.
    • Updated docblocks.
    Open source →
  14. v4.5.2 11 Feb 2019
    Release notes
    • Fixed #116. If the output file doesn't exist, it will be created. If it cannot be created, an exception will still be thrown.
    Open source →
  15. v4.5.1 08 Jan 2019
    Release notes
    • Use class_alias() for ParagonIE\Halite\HiddenString to the outsourced library. This is deprecated and will be removed in version 5.
    Open source →
  16. v4.5.0 03 Jan 2019
    Release notes
    • Updated Psalm version from ^0|^1 to ^1|^2.
    • Moved HiddenString to a standalone library: https://travis-ci.org/paragonie/hidden-string
    Open source →
  17. v4.4.2 27 Mar 2018
    Release notes
    • Updated Psalm version from ^0|^1 to ^1.
    • Type-safety and documentation fixes.
    • Miscellaneous boyscouting. No bugs were found since 4.4.1.
    Open source →
  18. v4.4.1 27 Feb 2018
    Release notes
    • Fixed #97, set the minimum chunk size to 1.
    Open source →
  19. v4.4.0 04 Feb 2018
    Release notes
    • Fixed #90:
      • Introduced WeakReadOnlyFile, an alternative to ReadOnlyFile that allows file modes other than rb. The TOCTOU security guarantees are therefore slightly weaker with this class (hence the "Weak" part of the name).
      • Updated File to allow stream objects (ReadOnlyFile and MutableFile) to be passed direclty instead of strings (for filenames) and resources (for open file handles).
    Open source →
  20. v4.3.1 30 Jan 2018
    Release notes
    • Updated the Halite::VERSION constant which was previously still 4.2.0.
    • Documentation and unit testing improvements.
    Open source →
  21. v4.3.0 26 Jan 2018
    Release notes
    • You can now quickly turn a SignatureKeyPair object into a birationally equivalent EncryptionKeyPair object by invoking the getEncryptionKeyPair() method.
    • We now have 100% unit test coverage, in addition to our static analysis.
    Open source →
  22. v4.2.0 15 Jan 2018
    Release notes
    • Implemented Asymmetric::signAndEncrypt() and Asymmetric::verifyAndDecrypt(), which facilitates the GPG use-case of signed-then-encrypted messages between two parties' Ed25519 keypairs. Encryption is facilitated using birationally equivalent X25519 keys.
    • Removed our in-house implementations of binary-safe substr and strlen in favor of using the ones in the constant-time encoding library.
    Open source →
  23. v4.1.0 05 Jan 2018
    Release notes

    Added support for libsodium 1.0.15, which was previously broken in 4.0.x.

    Passwords should be autoamtically migrated, but if keys were being generated via KeyFactory::derive______Key() (fill in the blank), you'll need to change your usage of this API to get the same key as previously. Namely, you'll need to pass the SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 constant to the fourth argument after the password, salt, and security level.

            $key = KeyFactory::deriveEncryptionKey(
                new HiddenString('correct horse barry staple'),
    -             "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
    +             "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
    +             KeyFactory::INTERACTIVE,
    +             SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13
            );
    

    If you previously specified a security level, your diff might look like this:

            $key = KeyFactory::deriveEncryptionKey(
                new HiddenString('correct horse barry staple'),
                "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
    -             KeyFactory::SENSITIVE
    +             KeyFactory::SENSITIVE,
    +             SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13
            );
    
    Open source →
  24. v4.0.3 30 Jan 2018

    Nothing published for this version

  25. v4.0.2 08 Dec 2017
    Release notes

    This is mostly a boyscouting/documentation release. However, we now pass Psalm under the strictest setting (totallyTyped = true). This means that not only is our public interface totally type-safe, but Halite's internals are as well.

    Open source →
  26. v4.0.1 19 Oct 2017
    Release notes
    • Prompted by #67, Halite is now available under the terms of the Mozilla Public License 2.0 (MPL-2.0). Using Halite to build products that restrict user freedom (such as DRM) is highly discouraged, but not forbidden.
    Open source →
  27. v4.0.0 16 Sep 2017
    Release notes
    • Bump minimum PHP version to 7.2.0, which will be available before the end of 2017
    • New methods: encryptWithAd() and decryptWithAd(), for satisfying true AEAD needs
    • Encrypted password hashing through our Password class can also accept an optional, additional data parameter
    • HiddenString objects can now be directly compared
      • $hiddenString->equals($otherHiddenString)
    • Added Psalm to our Continuous Integration to assure Halite is fully type-safe
    • Updated unit tests to be compatible with PHPUnit 6
    Open source →
  28. v3.4.1 27 Mar 2018

    Nothing published for this version

  29. v3.4.0 29 Jan 2018
    Release notes

    This tag was signed with the committer’s verified signature .

    paragonie-security P.I.E. Security Team

    GPG key ID: 6B97A1C2826404DA

    Verified Learn about vigilant mode .

    e1c194e

    • Fixes #89 . Please upgrade to v4.3.0 or higher as soon as possible. We will no longer be supporting Halite version 3.x or older for free. If you need ongoing support for a legacy version of Halite, please get in contact with Paragon Initiative Enterprises about purchasing a long-term support contract.
    Open source →
  30. v3.3.0 19 Aug 2017

    Nothing published for this version

  31. v3.2.0 08 Dec 2016
    Release notes
    • Resolved #49, which requested making HiddenString defend against serialize() leaks.
    • Fixed an encoding issue which broke legacy passwords. (Discovered in the course of CMS Airship development.)
    • The File API now supports different encodings for signatures and checksums (more than just hex and binary).
    Open source →
  32. v3.1.1 26 Oct 2016
    Release notes
    • Fixed #44, which caused Halite to be unusable for Symfony users. Thanks, Usman Zafar.
    Open source →
  33. v3.1.0 22 Aug 2016
    Release notes
    • Added an export() method to KeyFactory, and congruent import*() methods. For example:
      • export($key) returns a HiddenString with a versioned and checksummed, hex-encoded string representing the key material.
      • importEncryptionKey($hiddenString) expects an EncryptionKey object or throws a TypeError
    Open source →
  34. v3.0.0 30 Jul 2016
    Release notes
    • Use paragonie/constant_time_encoding
    • We now default to URL-safe Base 64 encoding (RFC 4648)
    • API change: Plaintext and password inputs must be a HiddenString object.
    • Dropped support for version 1.
      • We no longer offer or use scrypt anywhere. Everything is Argon2 now.
      • KeyFactory no longer accepts a $legacy argument.
    • Added TrimmedMerkleTree to Structures.
    • Use is_callable() instead of function_exists() for better compatibility with Suhosin.
    Open source →
  35. v2.2.0 22 Aug 2016

    Nothing published for this version

  36. v2.1.3 29 Jul 2016

    Nothing published for this version

  37. v2.1.2 11 Jul 2016
    Release notes
    • Better docblocks, added unit test to prevent regressions.
    Open source →
  38. v2.1.1 15 May 2016
    Release notes
    • Prevent an undefined index error when calculating the root of an empty MerkleTree.
    Open source →
  39. v2.1.0 07 May 2016
    Release notes
    • Key derivation (via KeyFactory) can now accept an extra argument to specify the security level of the derived key.
      • Scrypt: INTERACTIVE or SENSITIVE
      • Argon2i: INTERACTIVE, MODERATE, or SENSITIVE
    • Password can now accept a security level argument. We recommend sticking with INTERACTIVE for end users, but if you'd rather make administrative accounts cost more to attack, now you can make that happen within Halite.
    • MerkleTree can now accept a personalization string for the hash calculation.
    • MerkleTree can output a specific hash length (between 16 and 64).
    • Both MerkleTree and Node now lazily calculate the Merkle root rather than calculating it eagerly. This results in less CPU waste.
    • Cleaned up the legacy cruft in the Key classes. Now they only accept a string in their constructor.
    Open source →
  40. v2.0.1 21 Apr 2016
    Release notes
    • Fixed conflict with PHP 7 string optimizations that was causing File::decrypt() to fail in PHP-FPM.
    • Introduced a new method, Util::safeStrcpy(), to facilitate safe string duplication without triggering the optimizer.
    Open source →
  41. v2.0.0 04 Apr 2016
    Release notes
    • Halite now requires:
      • PHP 7.0+
      • libsodium 1.0.9+
      • libsodium-php 1.0.3+
      • (You can use Halite::isLibsodiumSetupCorrectly() to verify the latter two)
    • Strictly typed everywhere
    • You can no longer pass a well-configured but generic Key object to most methods; you must pass the appropriate child class (i.e. Symmetric\Crypto::encrypt() expects an instance of Symmetric\Crypto\EncryptionKey.
    • Updated password hashing and key derivation to use Argon2i
    • File now uses a keyed BLAKE2b hash instead of HMAC-SHA256.
    • Key->get() was renamed to Key->getRawKeyMaterial()
    • Password now has a needsRehash() method which will return true if you're using an obsolete encryption and/or hashing method.
    • Util now has several new methods for generating BLAKE2b hashes:
      • hash()
      • keyed_hash()
      • raw_hash()
      • raw_keyed_hash()
    • Removed most of the interfaces in Contract
    Open source →
  42. v1.6.0 01 Oct 2017

    Nothing published for this version

  43. v1.5.1 29 Jul 2016

    Nothing published for this version

  44. v1.5.0 08 Mar 2016

    Nothing published for this version

  45. 1.4.0 17 Feb 2016

    Nothing published for this version

  46. 1.3.2 17 Jan 2016

    Nothing published for this version

  47. 1.3.1 14 Jan 2016

    Nothing published for this version

  48. 1.3.0 30 Dec 2015

    Nothing published for this version

  49. 1.2.0 14 Nov 2015

    Nothing published for this version

  50. 1.1.0 06 Nov 2015

    Nothing published for this version

  51. 1.0.0 06 Nov 2015

    Nothing published for this version

  52. 0.8.1 03 Nov 2015

    Nothing published for this version

  53. 0.8.0 02 Nov 2015

    Nothing published for this version

  54. 0.7.0 30 Oct 2015

    Nothing published for this version

  55. 0.6.0 26 Oct 2015

    Nothing published for this version

  56. 0.5.3 21 Oct 2015

    Nothing published for this version

  57. 0.5.2 17 Oct 2015

    Nothing published for this version

  58. 0.5.1 15 Oct 2015

    Nothing published for this version

  59. 0.5.0 14 Oct 2015

    Nothing published for this version

  60. 0.4.0 14 Oct 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive