Oblivious Pseudorandom Function
   HOME

TheInfoList



OR:

An oblivious pseudorandom function (OPRF) is a
cryptographic Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or '' -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adversarial behavior. More gen ...
function, similar to a keyed-hash function, but with the distinction that in an OPRF two parties cooperate to securely compute a pseudorandom function (PRF).


Definition

Specifically, an OPRF is a pseudorandom function with the following properties: * The parties compute: O = OPRF(I, S) * The first party (''the client''), knows the ''input'' (I) and learns the ''output'' (O) but does not learn the ''secret'' (S) * The second party (''the server''), knows the ''secret'' (S), but does not learn either the input (I), nor the output (O). * The function has the same security properties as any (cryptographically secure) pseudorandom function. Specifically it shall be hard to distinguish the output from true randomness. The function is called an ''oblivious'' pseudorandom function, because the second party is ''oblivious'' to the function's output. This party learns no new information from participating in the calculation of the result. However, because it is only the second party that holds the secret, the first party must involve the second party to calculate the output of the pseudorandom function (PRF). This requirement enables the second party to implement
access control In physical security and information security, access control (AC) is the action of deciding whether a subject should be granted or denied access to an object (for example, a place or a resource). The act of ''accessing'' may mean consuming ...
s, throttling, audit logging and other security measures.


History

While conventional pseudorandom functions computed by a single party were first formalized in 1986, it was not until 1997 that the first two-party oblivious pseudorandom function was described in the literature, but the term "oblivious pseudorandom function" was not coined until 2005 by some of the same authors.


Applications

OPRFs have many useful applications in
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
and
information security Information security is the practice of protecting information by mitigating information risks. It is part of information risk management. It typically involves preventing or reducing the probability of unauthorized or inappropriate access to data ...
. These include password-based key derivation, password-based
key agreement In cryptography, a key-agreement protocol is a protocol whereby two (or more) parties generate a cryptographic Key (cryptography), key as a function of information provided by each honest party so that no party can predetermine the resulting value ...
, password-hardening, untraceable
CAPTCHA Completely Automated Public Turing Test to tell Computers and Humans Apart (CAPTCHA) ( ) is a type of challenge–response authentication, challenge–response turing test used in computing to determine whether the user is human in order to de ...
s, password management, homomorphic
key management Key management refers to management of Key (cryptography), cryptographic keys in a cryptosystem. This includes dealing with the generation, exchange, storage, use, crypto-shredding (destruction) and replacement of keys. It includes cryptographic ...
, and private set intersection. An OPRF can be viewed as a special case of
homomorphic encryption Homomorphic encryption is a form of encryption that allows computations to be performed on encrypted data without first having to decrypt it. The resulting computations are left in an encrypted form which, when decrypted, result in an output th ...
, as it enables another party to compute a function over an encrypted input and produce a result (which remains encrypted) and therefore it learns nothing about what it computed.


Password-based key derivation

Most forms of password-based key derivation suffer from the fact that passwords usually contain a small amount of randomness (or entropy) compared to full-length 128- or 256-bit encryption keys. This makes keys derived from passwords vulnerable to
brute-force attack In cryptography, a brute-force attack or exhaustive key search is a cryptanalytic attack that consists of an attacker submitting many possible keys or passwords with the hope of eventually guessing correctly. This strategy can theoretically be ...
s. However, this threat can be mitigated by using the output of an OPRF that takes the password as input. If the secret key used in the OPRF is high-entropy, then the output of the OPRF will also be high-entropy. This thereby solves the problem of the password being low-entropy, and therefore vulnerable to cracking via brute force. This technique is called ''password hardening''. It fills a similar purpose as
key stretching In cryptography, key stretching techniques are used to make a possibly weak key, typically a password or passphrase, more secure against a brute-force attack by increasing the resources (time and possibly space) it takes to test each possible ke ...
, but password hardening adds significantly more entropy. Further, since each attempt at guessing a password that is hardened in this way requires interaction with a server, it prevents an offline attack, and thus enables the user or system administrator to be alerted to any password-cracking attempt. The recovered key may then be used for authentication (e.g. performing a PKI-based authentication using a
digital certificate In cryptography, a public key certificate, also known as a digital certificate or identity certificate, is an electronic document used to prove the validity of a public key. The certificate includes the public key and information about it, informa ...
and
private key Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
), or may be used to decrypt sensitive content, such as an encrypted file or crypto wallet.


Password-authenticated key exchange

A
password A password, sometimes called a passcode, is secret data, typically a string of characters, usually used to confirm a user's identity. Traditionally, passwords were expected to be memorized, but the large number of password-protected services t ...
can be used as the basis of a
key agreement In cryptography, a key-agreement protocol is a protocol whereby two (or more) parties generate a cryptographic Key (cryptography), key as a function of information provided by each honest party so that no party can predetermine the resulting value ...
protocol, to establish temporary session keys and mutually authenticate the client and server. This is known as a ''password-authenticated key exchange'' or PAKE. In basic authentication, the server learns the user's password during the course of the authentication. If the server is compromised, this exposes the user's password which compromises the security of the user. With PAKE, however, the user's password is not sent to the server, preventing it from falling into an eavesdropper's hands. It can be seen as an authentication via a
zero-knowledge password proof In cryptography, a zero-knowledge password proof (ZKPP) is a type of zero-knowledge proof that allows one party (the prover) to prove to another party (the verifier) that it knows a value of a password, without revealing anything other than the fa ...
. Various ' augmented forms' of PAKE incorporate an oblivious pseudorandom function so that the server never sees the user's password during the authentication, but nevertheless it is able to authenticate the client is in possession of the correct password. This is done by assuming only the client that knows the correct password can use the OPRF to derive the correct key. An example of an augmented PAKE that uses an OPRF in this way is '' OPAQUE''. Matthew Green
"Let’s talk about PAKE"
2018.
Recently, OPRFs have been applied to password-based key exchange to
back up Backup is the computing function of making copies of data to enable recovery from data loss. Backup may also refer to: Information technology * Backup (backup software), Apple Mac software * Backup and Restore, Windows software * Backup softwa ...
encrypted chat histories in
WhatsApp WhatsApp (officially WhatsApp Messenger) is an American social media, instant messaging (IM), and voice-over-IP (VoIP) service owned by technology conglomerate Meta. It allows users to send text, voice messages and video messages, make vo ...
and Facebook Messenger. A similar use case is planned to be added in Signal Messenger.


Untraceable CAPTCHAs

A CAPTCHA or "Completely Automated Public
Turing test The Turing test, originally called the imitation game by Alan Turing in 1949,. Turing wrote about the ‘imitation game’ centrally and extensively throughout his 1950 text, but apparently retired the term thereafter. He referred to ‘ iste ...
to tell Computers and Humans Apart" is a mechanism to prevent automated robots or (
bots The British Overseas Territories (BOTs) or alternatively referred to as the United Kingdom Overseas Territories (UKOTs) are the fourteen dependent territory, territories with a constitutional and historical link with the United Kingdom that, ...
) from accessing websites. Lately, mechanisms for running CAPTCHA tests have been centralized to services such as
Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
and
CloudFlare Cloudflare, Inc., is an American company that provides content delivery network services, cybersecurity, DDoS mitigation, wide area network services, reverse proxies, Domain Name Service, ICANN-accredited domain registration, and other se ...
, but this can come at the expense of user privacy. Recently, CloudFlare developed a privacy-preserving technology called "Privacy Pass". This technology is based on OPRFs, and enables the client's browser to obtain passes from CloudFlare and then present them to bypass CAPTCHA tests. Due to the fact that the CloudFlare service is oblivious to which passes were provided to which users, there is no way it can correlate users with the websites they visit. This prevents tracking of the user, and thereby preserves the user's privacy.


An improved password manager

A
password manager A password manager is a software program to prevent password fatigue by Random password generator, automatically generating, Autofill, autofilling and storing Password, passwords. It can do this for Application software, local applications or web ...
is software or a service that holds potentially many different account credentials on behalf of the user. Access to the password manager is thus highly sensitive: an attack could expose many credentials to the attacker. The first proposal for a password manager based on OPRFs was SPHINX. It uses two devices (such as the user's laptop and phone) which collaborate to compute a password for a given account (as identified by the username and website's domain name). Because the user's two devices exchange values according to an OPRF protocol, intercepting the connection between them does not reveal anything about the password or the internal values each device used to compute it. Requiring two devices to compute any password also ensures that a compromise of either device does not allow the attacker to compute any of the passwords. A downside of this approach is that the user always needs access to both devices whenever they want to log in to any of their accounts. An OPRF is used by the Password Monitor in
Microsoft Edge Microsoft Edge is a Proprietary Software, proprietary cross-platform software, cross-platform web browser created by Microsoft and based on the Chromium (web browser), Chromium open-source project, superseding Edge Legacy. In Windows 11, Edge ...
to allow querying a server for whether a credential (which the user saved in the browser) is known to be compromised, without needing to reveal this credential to the server.


A homomorphic key-management system

Similarly to securing passwords managed by a password manager, an OPRF can be used to enhance the security of a key-management system. For example, an OPRF enables a key-management system to issue
cryptographic keys A key in cryptography is a piece of information, usually a string of numbers or letters that are stored in a file, which, when processed through a cryptographic algorithm, can encode or decode cryptographic data. Based on the used method, the key c ...
to authenticated and authorized users, without ever seeing, learning, or being in a position to learn, any of the keys it provides to users.


Private set intersection

Private set intersection is a cryptographic technique that enables two or more parties to compare their private sets to determine which entries they share in common, but without disclosing any entries which they do not hold in common. For example, private set intersection could be used by two users of a social network to determine which friends they have in common, without revealing the identities of friends they do not have in common. To do this, they could share the outputs of an OPRF applied to the friend's identity (e.g., the friend's phone number or e-mail address). The output of the OPRF cannot be inverted to determine the identity of the user, and since the OPRF may be rate-limited, it will prevent a brute-force attack (e.g., iterating over all possible phone numbers).


Implementations

There are various mathematical functions that can serve as the basis to implement an OPRF. For example, methods from
asymmetric cryptography Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
, including
elliptic curve In mathematics, an elliptic curve is a smooth, projective, algebraic curve of genus one, on which there is a specified point . An elliptic curve is defined over a field and describes points in , the Cartesian product of with itself. If the ...
point multiplication, Diffie–Hellman modular exponentiation over a prime, or an RSA signature calculation.


EC and conventional Diffie–Hellman

Elliptic curves and prime order fields can be used to implement an OPRF. The essential idea is that the first party (the client), must cryptographically '' blind'' the input prior sending it to the second party. This blinding can be viewed as a form of
encryption In Cryptography law, cryptography, encryption (more specifically, Code, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the inf ...
that survives the computation performed by the second party. Therefore, the first party can
decrypt In cryptography, encryption (more specifically, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the information, known as plai ...
what it receives from the second party to "unblind" it, and thereby receive the same result it would have received had the input not been blinded. When the second party receives the blinded input, it performs a computation on it using a
secret Secrecy is the practice of hiding information from certain individuals or groups who do not have the "need to know", perhaps while sharing it with other individuals. That which is kept hidden is known as the secret. Secrecy is often controver ...
. The result of this computation must not reveal the secret. For example, the second party may perform a point multiplication of a point on an elliptic curve. Or it may perform a
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie–Hellman key exchange and RSA public/private keys. Modula ...
modulo a large
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
. The first party, upon receipt of the result, and with knowledge of the blinding-factor, computes a function that removes the blinding factor's influence on the result returned by the second party. This 'unblinds' the result, revealing the output of the OPRF (or an intermediate result which is then used by the client to compute the output of the OPRF, for example, by hashing this intermediate result).


Sample OPRF protocol

The following is
pseudocode In computer science, pseudocode is a description of the steps in an algorithm using a mix of conventions of programming languages (like assignment operator, conditional operator, loop) with informal, usually self-explanatory, notation of actio ...
for the calculations performed by the client and server using an elliptic-curve–based OPRF.


= Client-side calculation

= The following code represents calculations performed by the client, or the first party. byte[] computeOPRF(byte[] input) Notes: The client computes the Modular multiplicative inverse, multiplicative inverse of the blinding factor. This enables it to reverse the effect of the blinding factor on the result, and obtain the result the server would have returned had the client not blinded the input. As a final step, to complete the OPRF, the client performs a one-way hash on the result to ensure the OPRF output is
uniform A uniform is a variety of costume worn by members of an organization while usually participating in that organization's activity. Modern uniforms are most often worn by armed forces and paramilitary organizations such as police, emergency serv ...
, completely
pseudorandom A pseudorandom sequence of numbers is one that appears to be statistically random, despite having been produced by a completely deterministic and repeatable process. Pseudorandom number generators are often used in computer programming, as tradi ...
, and non-invertible.


= Server-side calculation

= The following code represents calculations performed by the server, or the second party. The server receives the ''blinded input'' value from the client, and may perform authentication, access control, request throttling, or other security measures before processing the request. It then uses its own secret to compute: ECPoint processRequest(ECPoint blindedInput, Scalar secret) It then returns the response, which is the blinded output, to the client. Notes: Because the elliptic curve point multiplication is computationally difficult to invert (like the
discrete logarithm In mathematics, for given real numbers a and b, the logarithm \log_b(a) is a number x such that b^x=a. Analogously, in any group G, powers b^k can be defined for all integers k, and the discrete logarithm \log_b(a) is an integer k such that b^k=a ...
problem, the client cannot feasibly learn the server's secret from the response it produces. Note, however, that this function is vulnerable to attacks by quantum computers. A client or third party in possession of a quantum computer could solve for the server's secret knowing the result it produced for a given input.


RSA blind signatures

When the output of a blind signature scheme is deterministic, it can be used as the basis of building an OPRF, e.g. simply by hashing the resulting signature. This is because due to the blinding, the party computing the blind signature learns neither the input (what is being signed) nor the output (the resulting digital signature).


Extensions

The OPRF construction can be extended in various ways. These include: verifiable, partially oblivious, threshold-secure, and post-quantum–secure versions.


Verifiable OPRF

Many applications require the ability of the first party to verify the OPRF output was computed correctly. For example, when using the output as a key to encrypt data. If the wrong value is computed, that encrypted data may be lost forever. Fortunately, most OPRFs support verifiability. For example, when using RSA blind signatures as the underlying construction, the client can, with the public key, verify the correctness of the resulting digital signature. When using OPRFs based on
elliptic curve In mathematics, an elliptic curve is a smooth, projective, algebraic curve of genus one, on which there is a specified point . An elliptic curve is defined over a field and describes points in , the Cartesian product of with itself. If the ...
or Diffie–Hellman, knowing the public key ''y = gx'' it is possible to use a second request to the OPRF server to create a
zero-knowledge proof In cryptography, a zero-knowledge proof (also known as a ZK proof or ZKP) is a protocol in which one party (the prover) can convince another party (the verifier) that some given statement is true, without conveying to the verifier any information ...
of correctness for the previous result.


Partially oblivious PRF

One modification to an OPRF is called a partially oblivious PRF, or P-OPRF. Specifically, a P-OPRF is any function with the following properties: * The parties compute: O = POPRF(H, E, S) * The first party (''the client''), knows the ''hidden input'' (H) and the ''exposed input'' (E) and learns the ''output'' (O) but does not learn the ''secret'' (S) * The second party (''the server''), knows the ''secret'' (S), and learns the ''exposed input'' (E), but does not learn either the ''hidden input'' (H), nor the ''output'' (O). The use case for this is when the server needs to implement specific throttling or access controls on the exposed input (E), for example, (E) could be a file path, or user name, for which the server enforces
access control In physical security and information security, access control (AC) is the action of deciding whether a subject should be granted or denied access to an object (for example, a place or a resource). The act of ''accessing'' may mean consuming ...
s, and only services requests when the requesting user is authorized. A P-OPRF based on bilinear pairings was used by the "Pythia PRF Service". Recently, versions of P-OPRFs not based on pairings have appeared, such as a version standardized in the
IETF The Internet Engineering Task Force (IETF) is a standards organization for the Internet standard, Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster ...
RFC 9497, as well in its more recent improvement.


Threshold implementations

For even greater security, it is possible to "thresholdize" the server, such that the secret (S) is not held by any individual server, and so the compromise of any single server, or a set of servers numbering below some defined threshold, will not expose the secret. This can be done by having each server be a shareholder in a secret-sharing scheme. Instead of using its secret to compute the result, each server uses its ''share'' of the secret to perform the computation. The client then takes some subset of the server's computed results, and combines them, for example by computing a protocol known as ''interpolation in the exponent''. This recovers the same result as if the client had interacted with a single server which has the full secret. This algorithm is used in various distributed cryptographic protocols.


Post-quantum–secure implementations

Finding efficient post-quantum–secure implementations of OPRFs is an area of active research.
"With the exception of OPRFs based on symmetric primitives, all known efficient OPRF constructions rely on discrete-log- or factoring-type hardness assumptions. These assumptions are known to fall with the rise of quantum computers."
Two possible exceptions are lattice-based OPRFs and isogeny-based OPRFs, but more research is required to improve their efficiency and establish their security. Recent attacks on isogenies raise doubts on the security of the algorithm. A more secure, but less efficient approach to realize a post-quantum–secure OPRF is to use a secure two-party computation protocol to compute a PRF using a symmetric-key construction, such as AES or
HMAC In cryptography, an HMAC (sometimes expanded as either keyed-hash message authentication code or hash-based message authentication code) is a specific type of message authentication code (MAC) involving a cryptographic hash function and a se ...
.


See also

*
Random oracle In cryptography, a random oracle is an oracle (a theoretical black box) that responds to every ''unique query'' with a (truly) random response chosen uniformly from its output domain. If a query is repeated, it responds the same way every tim ...
* Pseudorandom function family * Oblivious transfer *
Secure multi-party computation Secure multi-party computation (also known as secure computation, multi-party computation (MPC) or privacy-preserving computation) is a subfield of cryptography with the goal of creating methods for parties to jointly compute a function over their ...
*
Cryptographic protocol A cryptographic protocol is an abstract or concrete Communications protocol, protocol that performs a information security, security-related function and applies cryptographic methods, often as sequences of cryptographic primitives. A protocol desc ...
*
Homomorphic encryption Homomorphic encryption is a form of encryption that allows computations to be performed on encrypted data without first having to decrypt it. The resulting computations are left in an encrypted form which, when decrypted, result in an output th ...


References

{{Cryptography navbox Theory of cryptography Cryptographic primitives Pseudorandomness