承接 noxlogic/oprf 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

noxlogic/oprf

最新稳定版本:v0.9.1

Composer 安装命令:

composer require noxlogic/oprf

包简介

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

README 文档

README

Latest Version PHP Version License

PHP implementation of the Oblivious Pseudorandom Function (OPRF) protocol, base mode, as defined in RFC 9497 using the ristretto255-SHA-512 suite.

Compatible with liboprf.

Requirements

  • PHP 8.2 or higher
  • libsodium APIs provided by either:

Installation

composer require noxlogic/oprf

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

composer require paragonie/sodium_compat

Usage

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

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

$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

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

MIT - see LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固