Groups

Ref. Chapter 8 INTRODUCTION TO MODERN CRYPTOGRAPHY by Jonathan Katz and Yehuda Lindellbar

Let us consider $G$ a set. A binary operation over $G$ is a map $$ \begin{matrix} *: & G \times G & \rightarrow & G \\ &(g_1,g_2) & \rightarrow & h=:g_1*g_2\end{matrix} $$

Definition: Let us consider $G$ a set and a binary operation * over $G$ such that:

The pair $(G,*)$ is a group.

Definition: A group $(G,*)$ is abelian if

Examples

Excercise: write down the proofs.

Definition: Let $(G,*)$ be group. A subset $H\subseteq G$ is a subgroup if $(H,*)$ is a group.

The groups $(\{e\},*)$ and $(G,*)$ are trivial subgroups of $(G,*)$.

Proposition: Let $G$ be a group and $a,b,c\in G$. If $ac=bc$, then $a=b$.

Example: $( \mathbb Z_{24}, \cdot)$ is not a group.

Group Notation and Exponentiation

Let $(G,*)$ be group, $g,h\in G$ and $m \in \mathbb N^+$. It is usually convenient to encode the $*$ with a more familiar notations such as multiplication and sum.

Multiplicative notation: we set $g\cdot h=g*h$, we denote the identity as $1$ and the inverse as $g^{-1}$, and $g*g*g\dots*g$ the $m$-times operation as $g^m$.

Additive notation: we set $g+ h=g*h$, we denote the identity as $0$ and the inverse as $-g$, and $g*g*g\dots*g$ $m$-times operation as $m\cdot g$.

Exercise: Can you guess what is $g^{m}\cdot g^{m'}$? $mg +{m'}g$? $g^{-b}$?

CompFact: if the group operation can be computed in polynomial time then so can exponentiation.

Example

We can verify for some values that $m\cdot (a+b) \mod N= m\cdot a+m\cdot b\mod N$, and other properties.

Cyclic groups

Proposition: Let $(G,\cdot)$ be group and $g\in G $. Then $$ <g>= \{g^k : k\in \mathbb Z\}$$ is a subgroup of $G$.

Exercise: Proof!

If there exists an element $g$ such that $G=<g>$, we say that $G$ is cyclic and $g$ is a generator of $G$.

Example

Finite groups

Definition: Let $(G,*)$ be group. $|G|$ is the order of the group, and if $|G|$ is finite we say that $G$ is a finite group.

Lemma 1: Let $(G,\cdot)$ be a finite group with $m = |G|$, the order of the group. Then for any element $g\in G$, $g^m = 1$. Moreover, for any element $x\in \mathbb Z$, $g^x = g^{[x\mod m]}$.

Example: $\mathbb Z_N=\{0,1,\dots,N-1\}$ with the operation $+ \mod N$ is an abelian group of order $N$. Then for any $g \in \mathbb Z_N$ we have $ Ng=0 \mod N $. Moreover for any element $x\in \mathbb Z$ we have $x\cdot g = [x\mod N]\cdot g \mod N$.

The Group $\mathbb Z_N^*$

$\mathbb Z_N=\{0,1,\dots,N-1\}$ with the operation $[+ \mod N]$ is an abelian group. However, $\mathbb Z_N$ with $[\cdot \mod N]$ is not a group. (Why?)

Example

Let us consider $N=12$ and the multiplication $[\cdot \mod 12]$. We can observe:

However, we can consider the set of elements of $\mathbb Z_{N}$ which are invertible mod $N$. That can be characterized as $$\mathbb Z_{N}^{*} := \{a \in \mathbb Z_{N}: gcd(N,a)=1\} $$

Theorem: Let $N > 1$ be an integer. Then $\mathbb Z_{N}^{*}$ is an abelian group under multiplication modulo N .

Proof:

Remark: We used a lot that being invertible and gcd equal one are equivalent, but this is not obvious! Moreover, can you name all the property we used in the last equation?

Euler phi function

For an integer $N>1$ the Euler phi function is $$\phi(N)= |\{a \in \mathbb Z_{N}: gcd(N,a)=1\}|=|\mathbb Z_{N}^{*}|$$

Theorem: If $N= \prod_{j=1}^k p_j^{e_j}$ with $p_1<\dots<p_k$ prime integers and $e_1,\dots e_k\in\mathbb N^+$, $$ \phi(N)= \prod_{j=1}^k p_j^{e_j-1}(p_j-1).$$

Therefore, the order of $\mathbb Z_{N}^{*}$ can be computed using this formula if we know the factorisation of $N$.

CompOpenQuest: Given $N$, can we compute $\phi(N)$??

Example

We can derive from Lemma 1 the following:

Corollary Let $N>1$ be an integer and $a\in \mathbb Z_{N}^{*}$. Then $$ a^{\phi(N)}=1 \mod N.$$

Corollary Let $p>1$ be a prime integer and $a\in \mathbb Z_{p}^{*}$. Then $$ a^{p-1}=1 \mod p.$$

Example

Example (cyclic subgroups)

We want to generate a cyclic subgroup $G=<g>$ of $\mathbb Z_N^*$. From Lemma 1 we know in advance that the group as at most $\phi(N)$ elements.

Computational aspects

Modelling $\mathbb Z_N$ via python classes

$\mathbb Z_N=\{0,1,\dots,N-1\}$ with the operation $+ \mod N$ is an abelian group.

Ex: 1) Define the group via python classes.

2) Write functions to verify that your class is a group._

Definition

We want to represent $\mathbb Z_N$ as python class.

Verification

We want to verify:

We want to verify: