halite

High-level cryptography interface powered by libsodium

MPL-2.0 License

Downloads
5.5M
Stars
1.1K
Committers
24

Bot releases are visible (Hide)

halite - Version 4.3.0

Published by paragonie-scott over 6 years ago

  • 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.
halite - Version 4.2.0

Published by paragonie-scott almost 7 years ago

  • 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.
halite - Version 4.1.0

Published by paragonie-scott almost 7 years ago

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
        );
halite - Version 4.0.2

Published by paragonie-scott almost 7 years ago

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.

halite - Version 4.0.1 (Relicense to MPL-2.0)

Published by paragonie-scott about 7 years ago

  • 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.
halite - Version 1.6.0

Published by paragonie-scott about 7 years ago

Halite will attempt to use sodium_compat where ever it can. However, for best results, install version 1.0.6 of the libsodium extension from PECL.

The 1.x branch of Halite is the only version that still supports PHP 5. All future versions require PHP 7 or higher. Version 4 requires PHP 7.2.

halite - Version 4.0.0

Published by paragonie-scott about 7 years ago

  • 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
halite - Version 3.3.0

Published by paragonie-scott about 7 years ago

Fixes #61, Halite now works with the new libsodium v2 API from PECL. It also still works on the old v1 API.

halite - Version 3.2.0

Published by paragonie-scott almost 8 years ago

  • 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).
halite - Version 3.1.1

Published by paragonie-scott almost 8 years ago

  • Fixed #44, which
    caused Halite to be unusable for Symfony users. Thanks, Usman Zafar.
halite - Version 3.1.0

Published by paragonie-scott about 8 years ago

  • 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
halite - Version 2.2.0

Published by paragonie-scott about 8 years ago

  • Added an export() method to KeyFactory, and congruent import*()
    methods. For example:
    • export($key) returns a string with a versioned and
      checksummed, hex-encoded string representing the key material.
    • importEncryptionKey($string) expects an EncryptionKey
      object or throws a TypeError
halite - Version 2.1.3

Published by paragonie-scott about 8 years ago

Workaround for Suhosin bug (see #39).

halite - Version 1.5.1

Published by paragonie-scott about 8 years ago

Workaround for Suhosin bug (see #39).

halite - Version 3.0.0

Published by paragonie-scott about 8 years ago

Version 3.0.0 is a breaking change in several ways:

  1. We now default to URL-safe Base64 encoding (RFC 4648).
  2. We now require users wrap plaintext in a HiddenString object to hide it from stack traces in case an uncaught exception occurs.
  3. We are no longer backwards compatible with version 1.

The minimum PHP version for Halite 3 remains PHP 7.0.

List of changes from v2.1.2

  • 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.
halite - Version 2.1.2

Published by paragonie-scott over 8 years ago

No functional changes from 2.1.1, just cleaning our plate before switching gears to v3.

halite - Version 2.1.1

Published by paragonie-scott over 8 years ago

Prevent an undefined index error when calculating the root of an empty MerkleTree.

halite - Version 2.1.0

Published by paragonie-scott over 8 years ago

  • Minimum PECL libsodium version set to 1.0.6.
  • 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.
halite - Version 2.0.1

Published by paragonie-scott over 8 years ago

  • 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.
halite - Version 2.0.0

Published by paragonie-scott over 8 years ago

  • 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