Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
fbfe41d
Bump version.
omatamix Feb 19, 2019
164b02f
Removed in phpunit 7.
omatamix Feb 20, 2019
69bf8fc
Merge pull request #128 from omatamix/patch-1
paragonie-scott Mar 11, 2019
3b69767
Merge pull request #129 from omatamix/patch-2
paragonie-scott Mar 11, 2019
ca1ac7a
Change phpunit xml scheme to 8.0.
omatamix Mar 11, 2019
710f5d4
Bump phpunit version.
omatamix Mar 11, 2019
f00782d
Merge pull request #131 from omatamix/patch-3
paragonie-scott Mar 11, 2019
39ef9f0
Fix Psalm
paragonie-security Mar 11, 2019
0160ecb
Update README with link to halite-legacy.
paragonie-security Mar 11, 2019
56ccdca
Update CHANGELOG for v4.5.3
paragonie-security Mar 11, 2019
a66199d
Add void typ declaration to setUp method
paragonie-security Mar 11, 2019
464e0ce
Extends throwable to ensure all exceptions are throwable.
omatamix Mar 12, 2019
ed54c1d
Merge pull request #132 from omatamix/patch-1
paragonie-scott Mar 13, 2019
d8f9a1b
Docs: File::encryptData and File::decryptData
elliot-sawyer May 5, 2019
a63ab77
Decrypting a file to php://output is not allowed by MutableFile
May 14, 2019
b535780
use File::encrypt and File::decrypt
elliot-sawyer May 26, 2019
7a78196
Merge pull request #134 from christiaan/allow-streaming-to-outputbuffer
paragonie-scott Jun 5, 2019
daae21b
Merge pull request #133 from elliot-sawyer/patch-1
paragonie-scott Jun 5, 2019
96a1816
Add PHP 7.4 to unit tests
paragonie-security Jun 5, 2019
0617d7a
Update CHANGELOG for 4.5.4
paragonie-security Jun 5, 2019
3807734
PHP 7.4 isn't available on Travis yet.
paragonie-security Jun 5, 2019
ee3f51f
Update link for HiddenString
paragonie-security Jun 5, 2019
8f224d0
Cleanup examples a little. Possibly needs a rewrite in the future.
paragonie-security Jun 5, 2019
e571a26
Release v4.5.4
paragonie-security Jun 5, 2019
e249216
Update Sodium.stub.php
Jun 25, 2019
1a30200
Update sodium_stub.php
Jun 25, 2019
b9d54d5
Support stream wrappers that don't support \fstat() like php://input
larowlan Aug 2, 2019
72d226c
Don't recalculate hash if it exists and file is unmodified
larowlan Aug 9, 2019
67f9379
Update minimum sodium_compat
paragonie-security Sep 12, 2019
dc4d398
Merge pull request #138 from larowlan/master
paragonie-scott Sep 12, 2019
5584855
Merge pull request #140 from larowlan/read-only-hash-static
paragonie-scott Sep 12, 2019
8e9c814
Merge pull request #137 from padraigdoran/patch-3
paragonie-scott Sep 12, 2019
c3cf49a
Merge pull request #136 from padraigdoran/patch-2
paragonie-scott Sep 12, 2019
be87703
Merge branch 'master' of https://github.com/paragonie/halite
paragonie-security Sep 12, 2019
7b96cdc
Update changelog for 4.6.0
paragonie-security Sep 12, 2019
c51a3ca
Fixed copy/paste error in method docblock
klemens-u Jan 27, 2020
821ef22
Merge pull request #146 from klemens-u/patch-2
paragonie-security Feb 2, 2020
6b21367
Fix Travis CI
paragonie-security Feb 2, 2020
1e6a93e
Issue #153: Add support for SameSite cookie flag
alexekorn Jun 21, 2020
ebfc040
Updated comment to refer to Argon2id, not Argon2i
Aug 5, 2020
dbc6eea
Change 'Cryptographic doom principle' link
j-d Aug 27, 2020
fbb46ea
Merge pull request #156 from j-d/patch-1
paragonie-security Sep 2, 2020
b061756
Update to support PHP 8
paragonie-security Dec 3, 2020
e34585e
Wrap memzero call to prevent uncaught exceptions
paragonie-security Dec 3, 2020
88615b7
Boyscouting
paragonie-security Dec 3, 2020
e7adebc
Add note about message commitment
paragonie-security Dec 3, 2020
106d917
Merge pull request #155 from padraigdoran/patch-4
paragonie-security Dec 3, 2020
4c3beb1
Merge pull request #154 from zealsolutions/issue153
paragonie-security Dec 3, 2020
bcacdbe
Use sodium_compat 1.14+
paragonie-security Dec 3, 2020
907ba47
Prepare for v4.7.0
paragonie-security Dec 3, 2020
538a057
Allow hidden-string v2
paragonie-security Dec 6, 2020
74c70f2
Add ext/sodium to build instructions
paragonie-security Dec 6, 2020
9ff2c45
Remove ext/sodium from build instructions
paragonie-security Dec 6, 2020
1585629
Don't run slow tests unless ext/sodium is installed
paragonie-security Dec 6, 2020
6a7fbd7
Don't run any file tests unless libsodium is installed
paragonie-security Dec 6, 2020
1fc4828
Don't run these tests without ext/sodium
paragonie-security Dec 7, 2020
698df65
Remove access modifier final from private methods
junaidbinfarooq Dec 10, 2020
95575b8
Migrate from Travis CI to Github Actions
paragonie-security Apr 18, 2021
78e77b6
Merge pull request #158 from junaidbinfarooq/patch-1
paragonie-security Apr 18, 2021
15f4f9d
Merge branch 'master' of https://github.com/paragonie/halite into ga
paragonie-security Apr 18, 2021
6a2f6aa
Fix tests
paragonie-security Apr 18, 2021
68531b9
Let's troubleshoot CI
paragonie-security Apr 18, 2021
b6fd5bd
Skip this test if CI environment has weird perms
paragonie-security Apr 18, 2021
30ecdc6
Merge pull request #163 from paragonie/ga
paragonie-security Apr 18, 2021
7596d5c
Prepare for v4.8.0
paragonie-security Apr 18, 2021
f37b928
Fixes documentation
faizanakram99 Jul 29, 2021
e7bd658
Merge pull request #172 from faizanakram99/patch-1
paragonie-security Jul 29, 2021
6889341
Fix Psalm nits
paragonie-security Oct 4, 2021
d8549c2
Update event trigger
paragonie-security Oct 5, 2021
ca1d9a4
Begin v5 branch: Raise PHP minimum to 8.0
paragonie-security Oct 5, 2021
8d53eee
Update dependencies
paragonie-security Oct 5, 2021
00a2ecc
Update CHANGELOG
paragonie-security Oct 5, 2021
7cc6672
Switch to XChaCha20
paragonie-security Oct 5, 2021
8931e5e
Add support for AAD in file encryption
paragonie-security Oct 5, 2021
0cd5f26
Add asymmetric encryption, cache public keys
paragonie-security Oct 5, 2021
85aae26
Update CHANGELOG.md
paragonie-security Oct 5, 2021
b95dafc
Don't attempt on PHP <8
paragonie-security Oct 5, 2021
8ced082
Update File.php
paragonie-security Jan 19, 2022
cafe11a
Update CHANGELOG, gitignore
paragonie-security Jan 19, 2022
22a76fd
Update coding style for Halite v5
paragonie-security Jan 19, 2022
29a56a9
Update README.md
paragonie-security Jan 19, 2022
03d3840
Merge pull request #176 from paragonie/v5-dev
paragonie-security Jan 19, 2022
46266bf
Usability: Show value next to constant name
paragonie-security Jan 19, 2022
a361ad2
Remove .travis.yml
paragonie-security Jan 19, 2022
a6b8a74
Clarify HKDF
paragonie-security Jan 19, 2022
0c10d03
Boyscouting
paragonie-security Jan 19, 2022
1876f26
Security: Use HKDF to extract key from shared secret
paragonie-security Jan 19, 2022
4f7074e
Boyscouting
paragonie-security Jan 19, 2022
7d6cdc8
README: Bump major version, document WithAD
paragonie-security Jan 19, 2022
1bbf8ac
Use HKDF info parameter instead of salt for randomness
paragonie-security Jan 19, 2022
21cb61d
Begin Halite v5 documentation changes
paragonie-security Jan 19, 2022
40fd1ce
Cover new File methods
paragonie-security Jan 19, 2022
8103822
Cover AEAD better
paragonie-security Jan 19, 2022
f84ca26
Fix nit
paragonie-security Jan 19, 2022
e808619
Document splitKeys
paragonie-security Jan 19, 2022
0580191
Update Primitives doc
paragonie-security Jan 19, 2022
906280e
Merge pull request #177 from paragonie/v5-docs
paragonie-security Jan 19, 2022
5145360
Prioritize security entries in CHANGELOG
paragonie-security Jan 19, 2022
666f977
Halite 5.1: Drop PHP 8.0 support
paragonie-security May 23, 2022
ae6a31c
Use newer dependencies in CI
paragonie-security May 23, 2022
09fbcb5
Fix CI
paragonie-security May 23, 2022
9cad098
Fix psalm.xml
paragonie-security May 23, 2022
cfafc30
Update README.md
paragonie-security May 23, 2022
94e4bed
Update dependencies, test on newer PHP
paragonie-security Apr 19, 2024
a8f6c88
Merge pull request #190 from paragonie/dev-5.1.1
paragonie-security Apr 19, 2024
9744775
Update dependency on constant_time_encoding
paragonie-security May 8, 2024
ce69a91
Use SensitiveParameter
paragonie-security May 8, 2024
d34609d
Update CHANGELOG, CI config
paragonie-security May 8, 2024
aee2347
Merge pull request #191 from paragonie/sensitive-parameter
paragonie-security May 8, 2024
365e6e7
Fix PHP 8.4 deprecations
acbramley Jan 23, 2025
8f8974c
Merge pull request #194 from acbramley/php8.4-deprecations
paragonie-security Jan 23, 2025
07dff26
Update docs
paragonie-security Jan 23, 2025
ef9c722
Update CHANGELOG
paragonie-security Jan 23, 2025
8d9358c
Install PHPStan, level 5 for now
spaze Jan 23, 2025
4ee114e
Add $ before the variable name in `@property`
spaze Jan 23, 2025
1dc7546
Unreachable statement - code above always terminates
spaze Jan 23, 2025
7f1a551
array<int, TYPE> is incompatible with native type TYPE when using TYP…
spaze Jan 23, 2025
c1c5d20
Call to function is_string() with string will always evaluate to true.
spaze Jan 23, 2025
060615e
Document exceptions
spaze Jan 24, 2025
298652f
Proper types
spaze Jan 24, 2025
918aaa4
Use assertInstanceOf and assertIsString to perform an assertion while…
spaze Jan 24, 2025
0aac7a1
$config instanceof Config already checked
spaze Jan 24, 2025
5f045c0
Add PHPStan baseline ignoring "defensive development" errors
spaze Jan 24, 2025
46bfedd
Allow the developer to use local phpstan config
spaze Jan 24, 2025
ac1f3de
Can run PHPStan analysis with `composer test` and in CI
spaze Jan 24, 2025
b745ae4
Merge pull request #195 from spaze/spaze/phpstan
paragonie-security Jan 25, 2025
ccbaf5b
Replace all `http://` links with the `https://` URL they redirect to
GrahamCampbell Feb 1, 2025
8f1be6c
Merge pull request #196 from GrahamCampbell/update-http-links
paragonie-security Feb 2, 2025
d150e82
Require the latest Psalm 6.8
spaze Mar 4, 2025
76f3820
Ignore errors for now
spaze Mar 4, 2025
f187c7c
Remove redundant docblocks
spaze Mar 4, 2025
cb289fe
Run Psalm on all supported PHPs
spaze Mar 4, 2025
79729bc
Merge pull request #198 from spaze/spaze/psalm-6
paragonie-security Mar 9, 2025
490f184
feat: Remove access modifier `final` from private methods as such met…
junaidbinfarooq Aug 20, 2025
37095b2
Merge pull request #204 from junaidbinfarooq/feat/remove-final-access…
paragonie-security Aug 21, 2025
3439bf7
Ignore tests, workflows and .MD docs with "export-ignore" on .gitattr…
erikn69 Sep 16, 2025
a69c65a
Fix typo
erikn69 Sep 16, 2025
62f2b0a
Merge pull request #205 from erikn69/patch-1
paragonie-security Sep 18, 2025
de32b40
Expand test coverage
paragonie-security Sep 19, 2025
07a6b35
Merge pull request #206 from paragonie/pedantic-testing
paragonie-security Sep 19, 2025
c37099f
Attempt to fix coverage badge
paragonie-security Sep 19, 2025
298308d
Remove coverage badge for now
paragonie-security Sep 19, 2025
0b0cbe7
Use phpunit-coverage-badge
paragonie-security Sep 19, 2025
c57bf0e
Push coverage to .github
paragonie-security Sep 19, 2025
d9dcedd
Prevent Action cascading
paragonie-security Sep 19, 2025
909b840
Does enabling pcov fix this?
paragonie-security Sep 19, 2025
d6dd9ec
Make clover.xml
paragonie-security Sep 19, 2025
f556c75
Use PECL to install PCOV
paragonie-security Sep 19, 2025
e6f2c58
Make coverage its own file
paragonie-security Sep 19, 2025
30584ef
Try xdebug
paragonie-security Sep 19, 2025
6dcf633
Rename coverage test
paragonie-security Sep 19, 2025
76d4ff3
Let's try this
paragonie-security Sep 19, 2025
8ce0918
Maybe it's a XML issue
paragonie-security Sep 19, 2025
2867c39
Could it be this stupid?
paragonie-security Sep 19, 2025
e06e479
Clean up
paragonie-security Sep 19, 2025
d6e3944
This doesn't work
paragonie-security Sep 19, 2025
6335fcf
How silly of me
paragonie-security Sep 19, 2025
1b0f88b
Coverage can write
paragonie-security Sep 19, 2025
7307f26
Add access token
paragonie-security Sep 19, 2025
f80e7df
Attempt number aleph null
paragonie-security Sep 19, 2025
7813a22
Merge pull request #207 from paragonie/coverage-badge
paragonie-security Sep 19, 2025
e6fde47
Fix image-data scope
paragonie-security Sep 19, 2025
2cafe1a
Fix image path
paragonie-security Sep 19, 2025
196b979
Merge pull request #208 from paragonie/coverage-fix
paragonie-security Sep 19, 2025
d6ac9dc
Update CHANGELOG.md
paragonie-security Sep 19, 2025
12e7d1a
Add readme to output directory for coverage badge
paragonie-security Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text=auto

/.github export-ignore
/doc export-ignore
/test export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpstan* export-ignore
/phpunit* export-ignore
/psalm* export-ignore
Empty file added .github/output/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .github/output/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Coverage Output

If you are looking at the `image-data` branch, please know that this is just a hack to get the coverage badge working.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
phpunit:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
if: "!contains(github.event.head_commit.message, '[ci]')"
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium
ini-values: error_reporting=-1, display_errors=On
coverage: none

- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"

- name: PHPUnit tests
run: vendor/bin/phpunit

- name: PHPStan analysis
run: vendor/bin/phpstan
56 changes: 56 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Coverage

permissions:
contents: write

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
coverage:
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
if: "!contains(github.event.head_commit.message, '[ci]')"
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.4']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium, xdebug
ini-values: error_reporting=-1, display_errors=On
coverage: xdebug

- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"

- name: Ensure XML file is being loaded
run: cp phpunit.xml.dist phpunit.xml

- name: PHPUnit tests with coverage
run: vendor/bin/phpunit --coverage-clover clover.xml --coverage-html build/coverage-report

- name: phpunit-coverage-badge
uses: timkrase/[email protected]
with:
coverage_badge_path: .github/output/coverage.svg
push_badge: false

- name: Git push to image-data branch
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: .github/output
publish_branch: image-data
github_token: ${{ secrets.TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
32 changes: 32 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Psalm

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
psalm:
name: Psalm on PHP ${{ matrix.php-versions }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"

- name: Psalm static analysis
run: vendor/bin/psalm
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
/composer.lock
/composer.phar
/.idea/
/.phpunit.result.cache
/phpstan.neon
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

106 changes: 106 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,111 @@
# Changelog

## Version 5.1.4 (2025-09-18)

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

## Version 5.1.3 (2025-01-23)

* Merged [#184](https://github.com/paragonie/halite/pull/194), which fixes PHP 8.4 deprecations with nullable types.

## Version 5.1.2 (2024-05-08)

* Use `#[SensitiveParameter]` annotation on some inputs
* This is defense in depth; we already wrapped most in `HiddenString`
* Updated dependencies

## Version 5.1.1 (2024-04-19)

* Support both sodium_compat v1 and v2.
[Learn more here](https://paragonie.com/blog/2024/04/release-sodium-compat-v2-and-future-our-polyfill-libraries).

## Version 5.1.0 (2022-05-23)

* 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](https://github.com/paragonie/halite/issues/178).
* The 5.0.x branch will continue to *function* on PHP 8.0 but performance is
not guaranteed.

## Version 5.0.0 (2022-01-19)

* 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](https://crypto.stackexchange.com/a/67609). 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](https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Common.md#pae-definition)
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()`.

## Version 4.8.0 (2021-04-18)

* Merged [#158](https://github.com/paragonie/halite/pull/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.

## Version 4.7.1 (2020-12-06)

* Allow v2 of `paragonie/hidden-string` to be installed.

## Version 4.7.0 (2020-12-03)

* Merged [#154](https://github.com/paragonie/halite/pull/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](https://github.com/paragonie/halite/pull/146),
[#155](https://github.com/paragonie/halite/pull/155),
[#156](https://github.com/paragonie/halite/pull/156) --
Various documentation improvements.

## Version 4.6.0 (2019-09-12)

* Merged [#138](https://github.com/paragonie/halite/pull/138), which adds
remote stream support to `ReadOnlyFile`.
* Merged [#140](https://github.com/paragonie/halite/pull/140), which saves
some overhead on hash recalculation.
* Merged [#136](https://github.com/paragonie/halite/pull/136) and
[#137](https://github.com/paragonie/halite/pull/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.

## Version 4.5.4 (2019-06-05)

* Merged [#132](https://github.com/paragonie/halite/pull/132), which ensures
all Halite exceptions implement `Throwable`.
* Merged [#133](https://github.com/paragonie/halite/pull/133), which updates
the documentation for the `File` API.
Thanks [@elliot-sawyer](https://github.com/elliot-sawyer).
* Merged [#134](https://github.com/paragonie/halite/pull/134), which allows
`MutableFile` to be used on resources opened in `wb` mode.
Thanks [@christiaanbaartse](https://github.com/christiaanbaartse).
* Other minor documentation improvements.

## Version 4.5.3 (2019-03-11)

* Fixed some minor nuisances with Psalm and PHPUnit.
* Added reference to Halite-Legacy to the README.
* Updated docblocks.

## Version 4.5.2 (2019-02-11)

* Fixed [#116](https://github.com/paragonie/halite/issues/116). If the output file
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Exhibit A - Source Code Form License Notice

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Halite

[![Build Status](https://travis-ci.org/paragonie/halite.svg?branch=master)](https://travis-ci.org/paragonie/halite)
[![Build Status](https://github.com/paragonie/halite/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/halite/actions)
[![Static Analysis](https://github.com/paragonie/halite/actions/workflows/psalm.yml/badge.svg)](https://github.com/paragonie/halite/actions)
[![Latest Stable Version](https://poser.pugx.org/paragonie/halite/v/stable)](https://packagist.org/packages/paragonie/halite)
[![Latest Unstable Version](https://poser.pugx.org/paragonie/halite/v/unstable)](https://packagist.org/packages/paragonie/halite)
[![License](https://poser.pugx.org/paragonie/halite/license)](https://packagist.org/packages/paragonie/halite)
[![Downloads](https://img.shields.io/packagist/dt/paragonie/halite.svg)](https://packagist.org/packages/paragonie/halite)
[![Coverage Status](https://coveralls.io/repos/github/paragonie/halite/badge.svg?branch=master)](https://coveralls.io/github/paragonie/halite?branch=master)
[![Coverage Status](https://raw.githubusercontent.com/paragonie/halite/refs/heads/image-data/coverage.svg)](https://github.com/paragonie/halite/actions/workflows/coverage.yml)

**Halite** is a high-level cryptography interface that relies on [libsodium](https://pecl.php.net/package/libsodium)
for all of its underlying cryptography operations.
Expand Down Expand Up @@ -34,15 +35,19 @@ Before you can use Halite, you must choose a version that fits the requirements
of your project. The differences between the requirements for the available
versions of Halite are briefly highlighted below.

| | PHP | libsodium | PECL libsodium | Support |
|-------------------------------------------------------------|-------|-----------|----------------|---------------------------|
| Halite 4.1 and newer | 7.2.0 | 1.0.15 | N/A (standard) | :heavy_check_mark: Active |
| [Halite 4.0](https://github.com/paragonie/halite/tree/v4.0) | 7.2.0 | 1.0.13 | N/A (standard) | :heavy_check_mark: Active |
| [Halite 3](https://github.com/paragonie/halite/tree/v3.x) | 7.0.0 | 1.0.9 | 1.0.6 / 2.0.4 | :x: Not Supported |
| [Halite 2](https://github.com/paragonie/halite/tree/v2.2) | 7.0.0 | 1.0.9 | 1.0.6 | :x: Not Supported |
| [Halite 1](https://github.com/paragonie/halite/tree/v1.x) | 5.6.0 | 1.0.6 | 1.0.2 | :x: Not Supported |
| | PHP | libsodium | PECL libsodium | Support |
|--------------------------------------------------------------|-------|-----------|----------------|---------------------------|
| Halite 5.1 and newer | 8.1.0 | 1.0.18 | N/A (standard) | :heavy_check_mark: Active |
| Halite 5.0.x | 8.0.0 | 1.0.18 | N/A (standard) | :heavy_check_mark: Active |
| [Halite 4.1+](https://github.com/paragonie/halite/tree/v4.x) | 7.2.0 | 1.0.15 | N/A (standard) | :x: Not Supported |
| [Halite 4.0](https://github.com/paragonie/halite/tree/v4.0) | 7.2.0 | 1.0.13 | N/A (standard) | :x: Not Supported |
| [Halite 3](https://github.com/paragonie/halite/tree/v3.x) | 7.0.0 | 1.0.9 | 1.0.6 / 2.0.4 | :x: Not Supported |
| [Halite 2](https://github.com/paragonie/halite/tree/v2.2) | 7.0.0 | 1.0.9 | 1.0.6 | :x: Not Supported |
| [Halite 1](https://github.com/paragonie/halite/tree/v1.x) | 5.6.0 | 1.0.6 | 1.0.2 | :x: Not Supported |

If you need a version of Halite before 4.0, see the documentation relevant to that
Note: Halite 5.0.x works on PHP 8.0, but performance is worse than on PHP 8.1.

If you need a version of Halite before 5.1, see the documentation relevant to that
particular branch.

**To install Halite, you first need to [install libsodium](https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium).**
Expand All @@ -56,31 +61,37 @@ If you're stuck, [this step-by-step guide contributed by @aolko](doc/Install-Gui

Once you have the prerequisites installed, install Halite through [Composer](https://getcomposer.org/doc/00-intro.md):

composer require paragonie/halite:^4
composer require paragonie/halite:^5

### Commercial Support for Older Halite Versions

Free (gratis) support for Halite only extends to the most recent major version (currently 4).
Free (gratis) support for Halite only extends to the most recent major version (currently 5).

If your company requires support for an older version of Halite,
[contact Paragon Initiative Enterprises](https://paragonie.com/contact) to inquire about
commercial support options.

If you need an easy way to migrate from older versions of Halite, check out [halite-legacy](https://github.com/paragonie/halite-legacy).

## Using Halite in Your Project

Check out the [documentation](doc). The basic Halite API is designed for simplicity:

* Encryption
* Symmetric
* `Symmetric\Crypto::encrypt`([`HiddenString`](doc/Classes/HiddenString.md), [`EncryptionKey`](doc/Classes/Symmetric/EncryptionKey.md)): `string`
* `Symmetric\Crypto::encryptWithAD`([`HiddenString`](doc/Classes/HiddenString.md), [`EncryptionKey`](doc/Classes/Symmetric/EncryptionKey.md), `string`): `string`
* `Symmetric\Crypto::decrypt`(`string`, [`EncryptionKey`](doc/Classes/Symmetric/EncryptionKey.md)): [`HiddenString`](doc/Classes/HiddenString.md)
* `Symmetric\Crypto::decryptWithAD`(`string`, [`EncryptionKey`](doc/Classes/Symmetric/EncryptionKey.md), `string`): [`HiddenString`](doc/Classes/HiddenString.md)
* Asymmetric
* Anonymous
* `Asymmetric\Crypto::seal`([`HiddenString`](doc/Classes/HiddenString.md), [`EncryptionPublicKey`](doc/Classes/Asymmetric/EncryptionPublicKey.md)): `string`
* `Asymmetric\Crypto::unseal`(`string`, [`EncryptionSecretKey`](doc/Classes/Asymmetric/EncryptionSecretKey.md)): [`HiddenString`](doc/Classes/HiddenString.md)
* Authenticated
* `Asymmetric\Crypto::encrypt`([`HiddenString`](doc/Classes/HiddenString.md), [`EncryptionSecretKey`](doc/Classes/Asymmetric/EncryptionSecretKey.md), [`EncryptionPublicKey`](doc/Classes/Asymmetric/EncryptionPublicKey.md)): `string`
* `Asymmetric\Crypto::encryptWithAD`([`HiddenString`](doc/Classes/HiddenString.md), [`EncryptionSecretKey`](doc/Classes/Asymmetric/EncryptionSecretKey.md), [`EncryptionPublicKey`](doc/Classes/Asymmetric/EncryptionPublicKey.md), `string`): `string`
* `Asymmetric\Crypto::decrypt`(`string`, [`EncryptionSecretKey`](doc/Classes/Asymmetric/EncryptionSecretKey.md), [`EncryptionPublicKey`](doc/Classes/Asymmetric/EncryptionPublicKey.md)): [`HiddenString`](doc/Classes/HiddenString.md)
* `Asymmetric\Crypto::decryptWithAD`(`string`, [`EncryptionSecretKey`](doc/Classes/Asymmetric/EncryptionSecretKey.md), [`EncryptionPublicKey`](doc/Classes/Asymmetric/EncryptionPublicKey.md), `string`): [`HiddenString`](doc/Classes/HiddenString.md)
* Authentication
* Symmetric
* `Symmetric\Crypto::authenticate`(`string`, [`AuthenticationKey`](doc/Classes/Symmetric/AuthenticationKey.md)): `string`
Expand Down
Loading