Bias
The response bias is one of the fundamental metrics for the response behavior of PUFs. Large response bias enable trivial modeling attacks on the PUF as the attacker can just guess the more likely of the two responses.
PUF bias is in the literature also known as balance or uniformity.
Note that per bit encoding in pypuf, a bias of zero means a perfectly unbiased behavior, whereas bias of -1 and 1 means that the PUF under test always returns -1 and 1, respectively. To convert the pypuf bias value \(b\) into the more traditional 0-1-scale, use \(1/2 - b/2\).
- pypuf.metrics.bias(instance: Simulation, seed: int, N: int = 1000) ndarray
Approximates the bias of a given simulation by generating
Nrandom challenges using seedseedand computing the bias for each of the \(m \geq 1\) response bits given by theinstance,\[b_l = E_x \left[ f(x)_l \right],\]where \(f\) is the function computed by
instanceand \(f(x)_l, 1 \leq l \leq m\) is the \(l\)-th response bit.Arbiter PUF simulations in pypuf per additive delay model almost unbiased:
>>> from pypuf.simulation import ArbiterPUF >>> from pypuf.metrics import bias >>> bias(ArbiterPUF(n=128, seed=42), seed=1) -0.004
On the other hand, 2-XOR Arbiter PUFs can have relatively large bias [WP20].
>>> from pypuf.simulation import XORArbiterPUF >>> bias(XORArbiterPUF(n=64, k=2, seed=2), seed=2) -0.086
- pypuf.metrics.bias_data(responses: ndarray) ndarray
Given an arrays of responses of shape \((N, m)\), returns the \(m\) bias values of the response bits,
\[b_l = E_x \left[ f(x)_l \right],\]where \(f\) is the function given by
responsesand \(f(x)_l, 1 \leq l \leq m\) is the \(l\)-th response bit.If response length \(m\) is greater than 1, the bias is given for each bit seperately. To obtain the general bias, average the response.
Returns an array of shape \((m,)\).