Category theoretic description of construction of stage of Feistel network

45 Views Asked by At

From https://en.wikipedia.org/wiki/Feistel_cipher#Design

A Feistel network uses a round function, a function which takes two inputs – a data block and a subkey – and returns one output of the same size as the data block. In each round, the round function is run on half of the data to be encrypted, and its output is XORed with the other half of the data. This is repeated a fixed number of times, and the final output is the encrypted data. An important advantage of Feistel networks compared to other cipher designs such as substitution–permutation networks is that the entire operation is guaranteed to be invertible (that is, encrypted data can be decrypted), even if the round function is not itself invertible.

The trick here (at least, the trick I'm interested in) is that starting with any function $f(x)$, we can create an injective function by defining $g(x) = (x, f(x))$.

Is there a straightforward way to use products and functors in category theory to describe this operation?

1

There are 1 best solutions below

0
On BEST ANSWER

I am not sure if this answers your question (if not, please specify it), but for any morphism $f : X \to Y$ in a category with binary products we can produce its graph morphism $\Gamma_f : X \to X \times Y$ defined by $\Gamma_f(x) = (x,f(x))$ on generalized elements, or equivalently $\mathrm{pr}_1 \circ \Gamma_f = \mathrm{id}_X$ and $\mathrm{pr}_2 \circ \Gamma_f = f$. By its very construction this is a split monomorphism.