PHPackages                             noxlogic/oprf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. noxlogic/oprf

ActiveLibrary[Security](/categories/security)

noxlogic/oprf
=============

Oblivious Pseudorandom Function (OPRF) library for PHP, based on RFC 9497

v0.9.1(2mo ago)47MITPHP &gt;=8.2

Since May 4Compare

[ Source](https://github.com/jaytaph/oprf-php)[ Packagist](https://packagist.org/packages/noxlogic/oprf)[ RSS](/packages/noxlogic-oprf/feed)WikiDiscussions Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

oprf-php
========

[](#oprf-php)

[![Latest Version](https://camo.githubusercontent.com/831e2826e63a194068779c6940c5142ffc4921cd701211ab9b37ad14074e8a19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f786c6f6769632f6f7072662e737667)](https://packagist.org/packages/noxlogic/oprf)[![PHP Version](https://camo.githubusercontent.com/b6e22656b8e6330e9a2b306c3fe015fbe062d5772f7624170fa2dfeaa6a90d81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6e6f786c6f6769632f6f7072662e737667)](https://packagist.org/packages/noxlogic/oprf)[![License](https://camo.githubusercontent.com/9b85266854adf7461a5ad6f443c89f09abc90caf3e92a3a8e1b3da495f09201a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6f786c6f6769632f6f7072662d7068702e737667)](LICENSE)

PHP implementation of the **Oblivious Pseudorandom Function (OPRF)** protocol, base mode, as defined in [RFC 9497](https://www.rfc-editor.org/rfc/rfc9497) using the `ristretto255-SHA-512` suite.

Compatible with [liboprf](https://github.com/stef/liboprf).

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- libsodium APIs provided by either:
    - `ext-sodium` (recommended, libsodium &gt;= 1.0.18)
    - [`paragonie/sodium_compat`](https://github.com/paragonie/sodium_compat)

Installation
------------

[](#installation)

```
composer require noxlogic/oprf
```

If `ext-sodium` is unavailable, install the compatible polyfill:

```
composer require paragonie/sodium_compat
```

Usage
-----

[](#usage)

### Client side

[](#client-side)

```
use Noxlogic\Oprf\OprfClient;

$client = new OprfClient();

// Step 1 - blind the input and send $result->blindedElement to the server
$result = $client->blind($input);

// Step 3 - unblind the server's response and compute the pseudonym
$pseudonym = $client->finalize($input, $result->blind, $evaluatedElement);
```

### Server side

[](#server-side)

```
use Noxlogic\Oprf\OprfServer;

$server = new OprfServer();

// Generate and store a long-lived key
$key = $server->generateKey();

// Step 2 - evaluate the blinded element received from the client
$evaluatedElement = $server->evaluate($key, $blindedElement);
```

### Full round-trip

[](#full-round-trip)

```
$client = new OprfClient();
$server = new OprfServer();
$key    = $server->generateKey();

$blind     = $client->blind('my-input');
$evaluated = $server->evaluate($key, $blind->blindedElement);
$pseudonym = $client->finalize('my-input', $blind->blind, $evaluated);
```

The pseudonym is deterministic: the same input and server key always produce the same output, regardless of the random blind scalar chosen during `blind()`.

Development
-----------

[](#development)

```
composer test      # run PHPUnit
composer cs        # check code style
composer cs:fix    # fix code style
composer stan      # run PHPStan (level 8)
composer ci        # run all of the above
```

License
-------

[](#license)

MIT - see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance86

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

2

Last Release

73d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19b14ca62f80ce8c77ae749ddf04e2d4077451db9f701f3bd37dec1dc950c76b?d=identicon)[JayTaph](/maintainers/JayTaph)

---

Tags

cryptographyoprfvoprfrfc9497ristretto255pseudonym

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/noxlogic-oprf/health.svg)

```
[![Health](https://phpackages.com/badges/noxlogic-oprf/health.svg)](https://phpackages.com/packages/noxlogic-oprf)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k465.6M1.6k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k175.2M258](/packages/defuse-php-encryption)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4691.4M24](/packages/paragonie-ciphersweet)[simplito/elliptic-php

Fast elliptic curve cryptography

2302.4M275](/packages/simplito-elliptic-php)[rych/phpass

PHP Password Library: Easy, secure password management for PHP

248850.1k4](/packages/rych-phpass)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

107105.0k1](/packages/vlucas-pikirasa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
