CS 683 - Security and Privacy Spring 2018
Instructor: Karim Eldefrawy
University of San Francisco
http://www.cs.usfca.edu/~keldefrawy/teaching /spring2018/cs683/cs683_main.htm (https://goo.gl/t396Fw)
1
CS 683 - Security and Privacy Spring 2018 Instructor: Karim - - PowerPoint PPT Presentation
CS 683 - Security and Privacy Spring 2018 Instructor: Karim Eldefrawy University of San Francisco http://www.cs.usfca.edu/~keldefrawy/teaching /spring2018/cs683/cs683_main.htm (https://goo.gl/t396Fw) 1 Lecture 6 Groups, Rings, Fields and
Instructor: Karim Eldefrawy
University of San Francisco
http://www.cs.usfca.edu/~keldefrawy/teaching /spring2018/cs683/cs683_main.htm (https://goo.gl/t396Fw)
1
2
3
4
DEFINITION: A nonempty set G and operator @, (G,@), is a group if:
DEFINITION: A group (G,@) is ABELIAN if:
5
DEFINITION: An element g in G is a group generator of group (G,@) if: for all x in G, there exists i ≥ 0, such that: x = gi = g @ g @ g @ … @ g (i times) This means every element of the group can be generated by g using @. In other words, G=<g> DEFINITION: A group (G,@) is cyclic if a group generator exists! DEFINITION: Group order of a group (G,@) is the size of set G, i.e., |G| or #{G} or ord(G) DEFINITION: Group (G,@) is finite if ord(G) is finite.
6
DEFINITION: A structure (R,+,*) is a Ring if (R,+) is an Abelian group (usually with identity element denoted by 0) and the following properties hold:
In other words (R,+) is an Abelian group with identity element 0 and (R,*) is a Monoid with identity element 1≠0. A Monoid is a set with a single associative binary
The Ring is commutative Ring if
7
DEFINITION: A structure (F,+,*) is a Field if (F,+,*) is a commutative Ring and:
i.e., there exists an inverse element x-1 in R, such that: x * x-1 = 1.
8
G = Z = integers = { … -3, -2, -1, 0 , 1 , 2 …} the group operator is “+”, ordinary addition
9
G = Q - {0} = {a/b} where a, b in Z*
the group operator is “*”, ordinary multiplication
10
G = R - {0}
the group operator is “*”, ordinary multiplication
(the group is Abelian)
Remember:
11
G = Z+
N = integers mod N = {0 … N-1}
the group operator is “+”, modular addition
(the group is Abelian)
12
G = Z*
p
non-zero integers mod p = {1 … p-1}
the group operator is “*”, modular multiplication
because if GCD(x, p) =1 and GCD(y, p) = 1 then GCD(xy, p) = 1 (Note that x is in Z*P iff GCD(x, p)=1)
ux + vp = 1 = GCD(x, p)
13
G = {0, 1, 2, 3…}
the group operator is “^”, exponentiation
x^y ≠ y^x (non-Abelian)
(x^y)^z ≠ x^(y^z)
14
N : Positive Integers mod(N)
phi(N)
if GCD(x, N) =1 and GCD(y,N) = 1, GCD(x*y,N) = 1
ux + vN = 1 (mod N) = GCD(x,N) so, x-1 = u (= x phi(N)-1)
G = Z*
N
non-zero integers mod N = {1 …, x, … n-1} such that GCD(x, N)=1
15
/ (ad-bc)
a b c d
1 0 0 1
a b c d
d -b
Recall: a square matrix is non-singular if its determinant is non-
matrix has an inverse.
16
2 5 10 30
3 -0.5
2 5 10 30
3 5 1 2
11 20 60 110
3 5 1 2 [ ] 2 5 10 30
56 165 22 65
17
DEFINITION: (H,@) is a subgroup of (G,@) if:
18
Let (G,*), G = Z*7 = {1, 2, 3, 4, 5, 6} Let H = {1, 2, 4} (mod 7) Note that:
19
Let (G,*), G = R-{0} = non-zero reals Let (H,*), Q-{0} = non-zero rationals H is a subset of G and both G and H are groups in their own right
20
Let x be an element of a (multiplicative) finite integer group G. The order of x is the smallest positive number k such that xk= 1 Notation: ord(x)
21
Example: Z*7: multiplicative group mod 7 Note that: Z*
7=Z7
22
Theorem (Lagrange): Let G be a multiplicative group
element! any
largest n
* n
G
( Φ
n mod g m
m
1 such that integer smallest : g
≡
1 1 : thus / / )
) ( )
: because mod 1 : 1 COROLLARY
/ 1 / ) ( * ) (
= = = Φ = = = Φ ∈ ∀ ≡
Φ Φ Φ k k (n) n * n * n n n
b b k (n) k (Z b
(Z (n) Z b n b
23
13
element primitive ) ( ) 2 ) 1 then prime is p if : 2 COROLLARY
*
− − = ∍ ∈ ∃ ≡ ∈ ∀ a 1 p a
Z a and p mod b b Z b
p p p
24
Purpose: compute GCD(x,y) GCD = Greatest Common Divisor
1 ) , gcd( mod 1 * ,
1 1 1
= ⇔ ∃ Ζ ∈ ∀ ≡ −
− − −
n b b b n b b b se tive inver multiplica b
n
Recall that:
1
1 ) , (
−
∃ ⇒ = b b n Euclidian
25
init : r
0 = x r 1 = y
q1 = r
0 / r 1
⎢ ⎣ ⎥ ⎦ r
2 = r 0 mod r 1
...= ... qi = r
i−1 / r i
⎢ ⎣ ⎥ ⎦ r
i+1 = r i−1mod r i
... = ... qm−1 = r
m−2 / r m−1
⎢ ⎣ ⎥ ⎦ r
m = r m−2mod r m−1
(r
m == 0)?
OUTPUT r
m−1
Example: x=24, y=15
Example: x=23, y=14
26
Purpose: compute GCD(x,y) and inverse of y (if it exists)
init : r
0 = x r 1 = y t0 = 0 t1 =1
q1 = r
0 / r 1
⎢ ⎣ ⎥ ⎦ r
2 = r 0 mod r 1 t1 =1
...= ... qi = r
i−1 / r i
⎢ ⎣ ⎥ ⎦ r
i+1 = r i−1mod r i ti = ti−2 − qi−1ti−1 mod r
... = ... qm−1 = r
m−2 / r m−1
⎢ ⎣ ⎥ ⎦ r
m = r m−2mod r m−1 tm = tm−2 − qm−1tm−1 mod r
if (r
m =1) OUTPUT tm else if (rm = 0) OUTPUT "no inverse"
27
Theorem:
) 1 (
1
> = i r t r
i i
r tm 1
1 =
I R T Q 87
11 1 7 2 10 80 1 3 1 8
! "
r mod t q t t r mod r r r r q
i i i i i i 1 i i i i 1 1 2 1 1
/
− − − − + −
− = = =
28
I R T Q__ 93
87 1 1 2 6 92 14 3 3 15 2 4 0 62
! "
r mod t q t t r mod r r r r q
i i i i i i 1 i i i i 1 1 2 1 1
/
− − − − + −
− = = =
29
The following system of n modular equations (congruences)
n n 1
m mod a x m mod a x ≡ ≡ ...
1
Has a unique solution:
i i i n 1 n i i i i
m mod m M y m m M M mod y m M a x
1 1
* ... * : where
− =
" " # $ % % & ' = = " " # $ % % & ' = ∑
(all mi-s relatively prime).
30
47 77 mod x mod y 7 mod mod y m M m M M M mod y m M y m M x = + = = = = = = = = = + =
− − −
) 8 * 7 * 3 2 * 11 * 5 ( 8 11 7 2 4 7 11 7 / 11 / 77 ] ) / ( 3 ) / ( 5 [
1 2 1 1 1 2 1 2 2 1 1