In cryptography, a pseudorandom function family, abbreviated PRF, is a collection of efficiently-computable functions which emulate a random oracle in the following way: no efficient algorithm can distinguish (with significant advantage) between a function chosen randomly from the PRF family and a random oracle (a function whose outputs are fixed completely at random). Pseudorandom functions are vital tools in the construction of cryptographic primitives, especially secure encryption schemes.
Pseudorandom functions are not to be confused with pseudorandom generators (PRGs). The guarantee of a PRG is that a single output appears random if the input was chosen at random. On the other hand, the guarantee of a PRF is that all its outputs appear random, regardless of how the corresponding inputs were chosen, as long as the function was drawn at random from the PRF family.
A pseudorandom function family can be constructed from any pseudorandom generator, using, for example, the "GGM" construction given by Goldreich, Goldwasser, and Micali.[1] While in practice, block ciphers are used in most instances where a pseudorandom function is needed, they do not, in general, constitute a pseudorandom function family, as block ciphers such as AES are defined for only limited numbers of input and key sizes.[2]
A PRF is an efficient (i.e. computable in polynomial time), deterministic function that maps two distinct sets (domain and range) and looks like a truly random function.
Essentially, a truly random function would just be composed of a lookup table filled with uniformly distributed random entries. However, in practice, a PRF is given an input string in the domain and a hidden random seed and runs multiple times with the same input string and seed, always returning the same value. Nonetheless, given an arbitrary input string, the output looks random if the seed is taken from a uniform distribution.
A PRF is considered to be good if its behavior is indistinguishable from a truly random function. Therefore, given an output from either the truly random function or a PRF, there should be no efficient method to correctly determine whether the output was produced by the truly random function or the PRF.
Pseudorandom functions take inputs
x\in\{0,1\}*
I=|x|
λ
n:=|s|
A family of functions,
is pseudorandom if the following conditions are satisfied:fs:\left\{0,1\right\}I(n) → \left\{0,1\right\}λ(n)
fs(x)
s
x
Fn
fs
s
\{0,1\}n
RFn
\{0,1\}I(n)
\{0,1\}λ(n)
Fn
RFn
Fn
RFn
n
In an oblivious pseudorandom function, abbreviated OPRF, information is concealed from two parties that are involved in a PRF.[4] That is, if Alice cryptographically hashes her secret value, cryptographically blinds the hash to produce the message she sends to Bob, and Bob mixes in his secret value and gives the result back to Alice, who unblinds it to get the final output, Bob is not able to see either Alice's secret value or the final output, and Alice is not able to see Bob's secret input, but Alice sees the final output which is a PRF of the two inputs -- a PRF of Alice's secret and Bob's secret. This enables transactions of sensitive cryptographic information to be secure even between untrusted parties.
An OPRF is used in some implementations of password-authenticated key agreement.[5]
An OPRF is used in the Password Monitor functionality in Microsoft Edge.[6]
See the main article on Oblivious Pseudorandom Functions.
PRFs can be used for:[7]
. Oded Goldreich . Foundations of Cryptography: Basic Tools . 2001 . Cambridge University Press . Cambridge . 978-0-511-54689-1.