# Deriving keys from low-entropy data

## Pseudorandom Functions (PRF)

A standard pseudorandom function, without obliviousness, takes a secret key and mixes it with an input to give a pseudorandom output. If you don't know the secret, it is computationally not feasible tell the difference between the output and pure randomness. This is great for turning data into keys, but it "sees" the data so can't be used with sensitive data.

### Oblivious Pseudorandom Function

An oblivious pseudorandom function is a pseudrandom function on hidden input. Human Network employs a particular type of OPRF called 2HashDH introduced by Jarecki, Kiayias, and, Krawczyk in 2014.

#### 2HashDH Oblivious pseudorandom function (OPRF)

The PRF in 2HashDH for input `x` and key `k` is.

```
hashToScalar(
    k * hashToCurve(x)
)
```

But the "server" (in our case, the network) never sees `hashToCurve(x)`. Rather, the client generates a random mask `r` to hide its input and sends

`r * hashtoCurve(x)`

The server multiples this by `k` and returns the resulting value. Then, the client multiples this result by `r^(-1`). The client and server have together computed this PRF without revealing the client's input!

## OPRF Architecture Sequence Diagram

<figure><img src="/files/XPaSoFE8V7Yoail2akqq" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.network.human.tech/overview/methods-and-their-use-cases/deriving-keys-from-low-entropy-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
