# Homomorphic signatures for network coding

Network coding has been shown to optimally use bandwidth in a network, maximizing information flow but the scheme is very inherently vulnerable to pollution attacks by malicious nodes in the network. A node injecting garbage can quickly affect many receivers. The pollution of network packets spreads quickly since the output of (even an) honest node is corrupted if at least one of the incoming packets is corrupted. An attacker can easily corrupt a packet even if it is encrypted by either forging the signature or by producing a collision under the hash function. This will give an attacker access to the packets and the ability to corrupt them. Denis Charles, Kamal Jain and Kristin Lauter designed a new homomorphic encryption signature scheme for use with network coding to prevent pollution attacks.[1] The homomorphic property of the signatures allows nodes to sign any linear combination of the incoming packets without contacting the signing authority. In this scheme it is computationally infeasible for a node to sign a linear combination of the packets without disclosing what linear combination was used in the generation of the packet. Furthermore, we can prove that the signature scheme is secure under well known cryptographic assumptions of the hardness of the discrete logarithm problem and the computational Elliptic curve Diffie–Hellman.

## Network coding

Let ${\displaystyle G=(V,E)}$ be a directed graph where ${\displaystyle V}$ is a set, whose elements are called vertices or nodes, and ${\displaystyle E}$ is a set of ordered pairs of vertices, called arcs, directed edges, or arrows. A source ${\displaystyle s\in V}$ wants to transmit a file ${\displaystyle D}$ to a set ${\displaystyle T\subseteq V}$ of the vertices. One chooses a vector space ${\displaystyle W/\mathbb {F} _{p}}$(say of dimension ${\displaystyle d}$), where ${\displaystyle p}$ is a prime, and views the data to be transmitted as a bunch of vectors ${\displaystyle w_{1},\ldots ,w_{k}\in W}$. The source then creates the augmented vectors ${\displaystyle v_{1},\ldots ,v_{k}}$ by setting ${\displaystyle v_{i}=(0,\ldots ,0,1,\ldots ,0,w_{i_{1}},\ldots ,w{i_{d}})}$ where ${\displaystyle w_{i_{j}}}$ is the ${\displaystyle j}$-th coordinate of the vector ${\displaystyle w_{i}}$. There are ${\displaystyle (i-1)}$ zeros before the first '1' appears in ${\displaystyle v_{i}}$. One can assume without loss of generality that the vectors ${\displaystyle v_{i}}$ are linearly independent. We denote the linear subspace (of ${\displaystyle \mathbb {F} _{p}^{k+d}}$ ) spanned by these vectors by ${\displaystyle V}$ . Each outgoing edge ${\displaystyle e\in E}$ computes a linear combination, ${\displaystyle y(e)}$, of the vectors entering the vertex ${\displaystyle v=in(e)}$ where the edge originates, that is to say

${\displaystyle y(e)=\sum _{f:\mathrm {out} (f)=v}(m_{e}(f)y(f))}$

where ${\displaystyle m_{e}(f)\in \mathbb {F} _{p}}$. We consider the source as having ${\displaystyle k}$ input edges carrying the ${\displaystyle k}$ vectors ${\displaystyle w_{i}}$. By induction, one has that the vector ${\displaystyle y(e)}$ on any edge is a linear combination ${\displaystyle y(e)=\sum _{1\leq i\leq k}(g_{i}(e)v_{i})}$ and is a vector in ${\displaystyle V}$ . The k-dimensional vector ${\displaystyle g(e)=(g_{1}(e),\ldots ,g_{k}(e))}$ is simply the first k coordinates of the vector ${\displaystyle y(e)}$. We call the matrix whose rows are the vectors ${\displaystyle g(e_{1}),\ldots ,g(e_{k})}$, where ${\displaystyle e_{i}}$ are the incoming edges for a vertex ${\displaystyle t\in T}$, the global encoding matrix for ${\displaystyle t}$ and denote it as ${\displaystyle G_{t}}$. In practice the encoding vectors are chosen at random so the matrix ${\displaystyle G_{t}}$ is invertible with high probability. Thus any receiver, on receiving ${\displaystyle y_{1},\ldots ,y_{k}}$ can find ${\displaystyle w_{1},\ldots ,w_{k}}$ by solving

${\displaystyle {\begin{bmatrix}y'\\y_{2}'\\\vdots \\y_{k}'\end{bmatrix}}=G_{t}{\begin{bmatrix}w_{1}\\w_{2}\\\vdots \\w_{k}\end{bmatrix}}}$

where the ${\displaystyle y_{i}'}$ are the vectors formed by removing the first ${\displaystyle k}$ coordinates of the vector ${\displaystyle y_{i}}$.

Each receiver, ${\displaystyle t\in T}$, gets ${\displaystyle k}$ vectors ${\displaystyle y_{1},\ldots ,y_{k}}$ which are random linear combinations of the ${\displaystyle v_{i}}$’s. In fact, if

${\displaystyle y_{i}=(\alpha _{i_{1}},\ldots ,\alpha _{i_{k}},a_{i_{1}},\ldots ,a_{i_{d}})}$

then

${\displaystyle y_{i}=\sum _{1\leq j\leq k}(\alpha _{ij}v_{j}).}$

Thus we can invert the linear transformation to find the ${\displaystyle v_{i}}$’s with high probability.

## History

Krohn, Freedman and Mazieres proposed a theory[2] in 2004 that if we have a hash function ${\displaystyle H:V\longrightarrow G}$ such that:

Then server can securely distribute ${\displaystyle H(v_{i})}$ to each receiver, and to check if

${\displaystyle y=\sum _{1\leq i\leq k}(\alpha _{i}v_{i})}$

we can check whether

${\displaystyle H(y)=\sum _{1\leq i\leq k}(\alpha _{i}H(v_{i}))}$

The problem with this method is that the server needs to transfer secure information to each of the receivers. The hash functions ${\displaystyle H}$ needs to be transmitted to all the nodes in the network through a separate secure channel.${\displaystyle H}$ is expensive to compute and secure transmission of ${\displaystyle H}$ is not economical either.

1. Establishes authentication in addition to detecting pollution.
2. No need for distributing secure hash digests.
3. Smaller bit lengths in general will suffice. Signatures of length 180 bits have as much security as 1024 bit RSA signatures.
4. Public information does not change for subsequent file transmission.

## Signature scheme

The homomorphic property of the signatures allows nodes to sign any linear combination of the incoming packets without contacting the signing authority.

### Elliptic curves cryptography over a finite field

Elliptic curve cryptography over a finite field is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields.

Let ${\displaystyle \mathbb {F} _{q}}$ be a finite field such that ${\displaystyle q}$ is not a power of 2 or 3. Then an elliptic curve ${\displaystyle E}$ over ${\displaystyle \mathbb {F} _{q}}$ is a curve given by an equation of the form

${\displaystyle y^{2}=x^{3}+ax+b,\,}$
${\displaystyle E(K)=\{(x,y)|y^{2}=x^{3}+ax+b\}\bigcup \{O\}}$

forms an abelian group with O as identity. The group operations can be performed efficiently.

### Weil pairing

Weil pairing is a construction of roots of unity by means of functions on an elliptic curve ${\displaystyle E}$, in such a way as to constitute a pairing (bilinear form, though with multiplicative notation) on the torsion subgroup of ${\displaystyle E}$. Let ${\displaystyle E/\mathbb {F} _{q}}$ be an elliptic curve and let ${\displaystyle \mathbb {\bar {F}} _{q}}$ be an algebraic closure of ${\displaystyle \mathbb {F} _{q}}$. If ${\displaystyle m}$ is an integer, relatively prime to the characteristic of the field ${\displaystyle \mathbb {F} _{q}}$, then the group of ${\displaystyle m}$-torsion points, ${\displaystyle E[m]={P\in E(\mathbb {\bar {F}} _{q}):mP=O}}$.

${\displaystyle E[m]\cong (\mathbb {Z} /m\mathbb {Z} )*(\mathbb {Z} /m\mathbb {Z} )}$

Also, ${\displaystyle e_{m}}$ can be computed efficiently.[3]

### Homomorphic signatures

The server chooses ${\displaystyle s_{1},\ldots ,s_{D}}$ secretly in ${\displaystyle \mathbb {F} _{p}}$ and publishes a point ${\displaystyle Q}$ of p-torsion such that ${\displaystyle e_{p}(P_{i},Q)\not =1}$ and also publishes ${\displaystyle (P_{i},s_{i}Q)}$ for ${\displaystyle 1\leq i\leq D}$. The signature of the vector ${\displaystyle v=u_{1},\ldots ,u_{D}}$ is ${\displaystyle \sigma (v)=\sum _{1\leq i\leq D}(u_{i}s_{i}P_{i})}$ Note: This signature is homomorphic since the computation of h is a homomorphism.

### Signature verification

Given ${\displaystyle v=u_{1},\ldots ,u_{D}}$ and its signature ${\displaystyle \sigma }$, verify that

{\displaystyle {\begin{aligned}e_{p}(\sigma ,Q)&=e_{p}\left(\sum _{1\leq i\leq D}(u_{i}s_{i}P_{i}),Q\right)\\&=\prod _{i}e_{p}(u_{i}s_{i}P_{i},Q)\\&=\prod _{i}e_{p}(u_{i}P_{i},s_{i}Q)\end{aligned}}}

The verification crucially uses the bilinearity of the Weil-pairing.

## System setup

The signature is a point on the elliptic curve with coordinates in ${\displaystyle \mathbb {F} _{q}}$. Thus the size of the signature is ${\displaystyle 2\log q}$ bits (which is some constant times ${\displaystyle log(p)}$ bits, depending on the relative size of ${\displaystyle p}$ and ${\displaystyle q}$), and this is the transmission overhead. The computation of the signature ${\displaystyle h(e)}$ at each vertex requires ${\displaystyle O(d_{in}\log p\log ^{1+\epsilon }q)}$ bit operations, where ${\displaystyle d_{in}}$ is the in-degree of the vertex ${\displaystyle in(e)}$. The verification of a signature requires ${\displaystyle O((d+k)\log ^{2+\epsilon }q)}$ bit operations.

## Proof of security

Attacker can produce a collision under the hash function.

${\displaystyle \sum _{1\leq i\leq r}(a_{i}P_{i})=\sum _{1\leq j\leq r}(b_{j}P_{j}).}$

Proposition: There is a polynomial time reduction from discrete log on the cyclic group of order ${\displaystyle p}$ on elliptic curves to Hash-Collision.

If we have r > 2 then we can do one of two things. Either we can take ${\displaystyle P_{1}=P}$ and ${\displaystyle P_{2}=Q}$ as before and set ${\displaystyle P_{i}=O}$ for ${\displaystyle i}$ > 2 (in this case the proof reduces to the case when ${\displaystyle r=2}$), or we can take ${\displaystyle P_{1}=r_{1}P}$ and ${\displaystyle P_{i}=r_{i}Q}$ where ${\displaystyle r_{i}}$ are chosen at random from ${\displaystyle \mathbb {F} _{p}}$. We get one equation in one unknown (the discrete log of ${\displaystyle Q}$). It is quite possible that the equation we get does not involve the unknown. However, this happens with very small probability as we argue next. Suppose the algorithm for Hash-Collision gave us that

${\displaystyle ar_{1}P+\sum _{2\leq i\leq r}(b_{i}r_{i}Q)=0.}$

Then as long as ${\displaystyle \sum _{2\leq i\leq r}b_{i}r_{i}\not \equiv 0{\bmod {p}}}$, we can solve for the discrete log of Q. But the ${\displaystyle r_{i}}$’s are unknown to the oracle for Hash-Collision and so we can interchange the order in which this process occurs. In other words, given ${\displaystyle b_{i}}$, for ${\displaystyle 2\leq i\leq r}$, not all zero, what is the probability that the ${\displaystyle r_{i}}$’s we chose satisfies ${\displaystyle \sum _{2\leq i\leq r}(b_{i}r_{i})=0}$? It is clear that the latter probability is ${\displaystyle 1 \over p}$ . Thus with high probability we can solve for the discrete log of ${\displaystyle Q}$.

We have shown that producing hash collisions in this scheme is difficult. The other method by which an adversary can foil our system is by forging a signature. This scheme for the signature is essentially the Aggregate Signature version of the Boneh-Lynn-Shacham signature scheme.[4] Here it is shown that forging a signature is at least as hard as solving the elliptic curve Diffie–Hellman problem. The only known way to solve this problem on elliptic curves is via computing discrete-logs. Thus forging a signature is at least as hard as solving the computational co-Diffie–Hellman on elliptic curves and probably as hard as computing discrete-logs.