A prototype of a self-hosted Oblivious Pseudo-Random Function (OPRF) service based on AWS Lambda + API Gateway.
This repository now includes:
- TypeScript build + typecheck configuration (
package.json,tsconfig.json) - Shared input/encoding utilities for server + client (
encodingUtils.ts) - Improved server input parsing and safer ID generation with cryptographic randomness
- Environment-based configuration for DynamoDB table name (
TABLE_NAME)
npm install
npm run typechecknode oprfClientDemo.js- Handler file:
oprfServerless.ts - Required DynamoDB table schema:
- Partition key:
id(String) - Attributes:
secretKey(stored as number array)
- Partition key:
- Optional env var:
TABLE_NAME(default:oprf-users)
oprfServerless.ts– Lambda handler for OPRF evaluation.oprfClient.ts– TypeScript client implementation.oprfClientDemo.js– demo runner against an OPRF endpoint.encodingUtils.ts– shared validators + encoding conversion helpers.
You can test a live instance at https://oprf.reich.org using the included client demo.