Docsity

Modular Arithmetic, Euler’s Theorem, Groups, Rings-Computer Security-Lecture Slides, Slides of Computer Security

Partial preview of the text

Download Modular Arithmetic, Euler’s Theorem, Groups, Rings-Computer Security-Lecture Slides and more Slides Computer Security in PDF only on Docsity!

Computer Security

Today’s Lecture

• Modular Arithmetic

 Modulus Calculation  Modulation Addition, Subtraction, Multiplication, Division, Exponentiation

• Group

• Rings

• Euler’s Theorem

Properties of Modular Arithmetic

  • If a=b mod n then b is called the residue of n

 E.g. 7=3 mod 4 ..3 is the residue (remainder)

  • For some modular system n (mod n ) the set of numbers

{ 0,1…..n-1} is called the set of residues or residue classes

  • Notation the set of residue is represented by Zn

 i.e. Zn = {0,1……..n-1} each element in Zn is a set of residue class  i.e. [0],[1],…[n-1] each is a residue class  Generically it an be written as follows [r]={a,a is an integer, a=r mod n }

Example (addition Modulo 8 )

Additive Inverse 0 ------ 1 7 2 6 3 5 4 4 5 3 6 2 7 1

  • The column that lies at the intersection of number and 0 in the table is inverse of the number

MOD Arithmetic Operations

  • Addition

 First add the two numbers,  Secondly, divide the sum by the modulus to compute the remainder.  Example:  11+10 = 21 mod 12 = 911 + 22 = 33 mod 12 = 9

  • Subtraction

 First subtract the two numbers,  Secondly, divide the sum by the modulus to compute the remainder.  Example  25 - 8 = 17 MOD 12 = 5  Case of Negative Answer  Example3 - 50 = -47 MOD 12 =?

 In case of negative numbers, to get the mod repeatedly add the mod in that number unless a positive remainder is obtained, an easy way is to use multiplication instead of repeated addition  Example 1:  3 - 50 = -47 MOD 12 = 1 since - 1 + 12 =11.  Example 2:  14 - 77 = -63 MOD 12 = 9 since -63 + 12 + 12 + 12 + 12 + 12 + 12 = 9  Example 3:  50 - 11 = -39 MOD 15 = 6 since -39 + 15 + 15 + 15 = 6

  • Multiplication

 First we multiply  Secondly find the remainder  Example  5 * 8 MOD 12?

  1. 5 * 8 = 40
  2. 40 MOD 12 = 4.

Computation Rules of Mod Arithmetic

  • a + b mod m = (a mod m) + (b mod m)
  • a - b mod m = (a mod m) - (b mod m)
  • a * b mod m = (a mod m) * (b mod m)

Group

• A group is a set of elements or “numbers”

• Denoted by {G,• }

• A group is such a set of elements or “numbers” that satisfies the

following conditions

Closure: If a and b belongs to G then a•b is also in G  For a selected operation, the result of the operation on any elements of the set should also be in the set

Associative law: (a•b) • c = a.(b•c)  Elements of the set should obey associative law for a selected operation

Groups..

  1. Checking Closure property

2+4=6, 5+7=12, 0+0=0, 6+9=15 ……the result seems to be in S The set has a closure property

  1. Associative Law

The set of integers follow associative law with respect to addition

  1. Identity Element

Adding 0 to any element preserves the element (no change) hence 0 is identity element in S with respect to addition

Groups..

  1. Inverse Element

Adding any two elements with opposite signs reveals 0 in S hence S has inverse of each element in S

  1. So is S a group?
    1. Yes

Is S also a group for subtraction (-) operation? Try yourself

Cyclic Group

• There are numbers that can be written as power of other

number  example: a^3 = a.a.a

• Also the identity element 0 can be written as e=a^0

• A group is cyclic if every element is a power of some fixed

element  ie b = ak^ for some a and every b in group

• a is said to be a generator of the group

• Example

 Set of all positive integers (excluding 0 ) under addition is a Cyclic group, generator of the group is 1, the powers means addition of 1  i.e. 1^3 means addiding 1 three times

Ring

• A set of “numbers” with two binary operations (addition and

multiplication) is said to be a Ring if it obeys the following properties:

• A ring is denoted by [R,+,x] or (R,+,x)

 Group under addition and multiplication  Associative with respect to addition and multiplication  Distributive law It should obey the distributive law with respect to addition distributive over addition: a(b+c) = ab + ac