active library

algebraic_cipher_types

Algebraic cipher types

Started 2019 C++

Resources & Distribution

Source Code

Package Registries

2 Stars

Algebraic Cipher Types

Before we can define the cipher functor, we need to define the algebraic structures that we will be working with. The cipher functor defines a way to lift a monoid into a cipher monoid.

Groups and Monoids

A group is a set, GG, together with an operation :G×GG* : G \times G \mapsto G that combines any two elements aa and bb to form another element aba*b. To qualify as a group, the set and operation, (G,)(G, *), must satisfy four requirements known as the group axioms:

  • Closure: For all a,bGa,b \in G, the result of the operation, aba*b, is also in GG.

  • Associativity: For all a,b,cGa,b,c \in G, $(ab)c = a(bc)$.

  • Identity element: There exists an element eGe \in G such that, for every element aGa \in G, the equation $ea = ae = a$ holds. Such an element is unique, and thus one speaks of the identity element.

  • Inverse element: For each aGa \in G, there exists an element aGa’ \in G such that $ab=ba=e,where, where e$ is the identity element.

A monoid (S,)(S,*) relaxes the requirement of a group by removing the requirements of an inverse element.

Cipher Functor

In the cipher functor, we lift a monoid $(S,)to to c_A(S,)$, which is defined in the following way:

  • AA is a subset of SS.

  • s:S×NcASs : S \times \mathbb{N} \mapsto c_A S maps SS to representations of ScASS \in c_A S, i.e., s(a,k)s(a,k) maps element aSa \in S to the kk-th representation of acAaa \in c_A a.

  • s:cASSs’ : c_A S \mapsto S satisfies s(s(a,k))=as’(s(a,k))=a and s(s(j),k)=cAas(s’(j),k)=c_A a for any aSa \in S and kNk \in N.

Typically, ss is generated by some other function parameterized by a secret and a fixed bit length for each representation.

cA(S,,e)c_A(S,*,e) has an operation (cA):(cAS,cAS)cAS(c_A *) : (c_A S, c_A S) \mapsto c_A S that is given by the following axioms:

  • Associativity: For all x,y,zAx,y,z \in A, $s’((c_A xc_A y)c_A z) = s’(c_A x(c_A yc_A z))$.

Discussion