Download the PHP package paragonie/hpke without Composer
On this page you can find all versions of the php package paragonie/hpke. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paragonie/hpke
More information about paragonie/hpke
Files in paragonie/hpke
Package hpke
Short Description Hybrid Public-Key Encryption (RFC 9180) for PHP
License ISC
Informations about the package hpke
Hybrid Public-Key Encryption (HPKE, RFC 9180) for PHP
Installation
Usage
Instantiating HPKE
First, you need to decide on an HPKE ciphersuite. You can build these yourself by component, or use the standard modes that ship with RFC 9180:
- DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM
- DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305
- DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, AES-128-GCM
- DHKEM(P-256, HKDF-SHA256), HKDF-SHA512, AES-128-GCM
- DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305
- DHKEM(P-521, HKDF-SHA512), HKDF-SHA512, AES-256-GCM
Additional Post-Quantum KEMs:
- MLKEM768-X25519, HKDF-SHA256, AES-128-GCM
- ML-KEM-768, HKDF-SHA256, AES-128-GCM
- ML-KEM-1024, HKDF-SHA256, AES-256-GCM
- MLKEM768-X25519, HKDF-SHA256, ChaCha20Poly1305
- ML-KEM-768, HKDF-SHA256, ChaCha20Poly1305
- ML-KEM-1024, HKDF-SHA256, ChaCha20Poly1305
[!TIP] We recommend enabling opcache and JIT if you cannot install the pqcrypto extension.
To instantiate one of these ciphersuites, you can use the Factory class, like so:
Generating and Managing Key Pairs
Once you've instantiated your ciphersuite, you can now use it to generate/load keys.
Setting Up Encryption Contexts
To set up an encryption context, simply use the setupBaseSender() and setupBaseReceiver()
APIs.
One-Shot Encryption API
All versions of hpke with dependencies
ext-gmp Version *
ext-openssl Version *
paragonie/pqcrypto_compat Version ^0|^1
paragonie/sodium_compat Version ^2
paragonie/easy-ecc Version ^1
paragonie/ecc Version ^2