Keamanan Informasi2 Pertemuan 4: Mohammad Hafiz Hersyah, M.T Rifki Suwandi, M.T
Keamanan Informasi2 Pertemuan 4: Mohammad Hafiz Hersyah, M.T Rifki Suwandi, M.T
Keamanan Informasi2 Pertemuan 4: Mohammad Hafiz Hersyah, M.T Rifki Suwandi, M.T
4
Mohammad Hafiz Hersyah, M.T
Rifki Suwandi, M.T
“Mathematics has long been known in the printing
trade as difficult, or penalty, copy because it is
slower, more difficult, and more expensive to
set in type than any other kind of copy.”
• If a | 1, then a = ±1
• If a | b and b | a, then a = ±b
• Any b ≠ 0 divides 0
• If a | b and b | c, then a | c
b = 7; g = 14; h = 63; m = 3; n = 2
7 | 14 and 7 | 63.
To show 7 (3 * 14 + 2 * 63),
we have (3 * 14 + 2 * 63) = 7(3 * 2 + 2 * 9),
and it is obvious that 7 | (7(3 * 2 + 2 * 9)).
Division Algorithm
a = qn + r 0 ≤ r < n; q = [a/n]
Euclidean Algorithm
• One of the basic techniques
of number theory
• Procedure for determining
the greatest common divisor
of two positive integers
• Two integers are relatively
prime if their only common
positive integer factor is 1
Greatest Common Divisor (GCD)
• The greatest common divisor of a and b is the
largest integer that divides both a and b
• We can use the notation gcd(a,b) to mean the
greatest common divisor of a and b
• We also define gcd(0,0) = 0
• Positive integer c is said to be the gcd of a and b if:
• c is a divisor of a and b
• Any divisor of a and b is a divisor of c
11 mod 7 = 4; - 11 mod 7 = 3
Modular Arithmetic
• Congruent modulo n
– Two integers a and b are said to be congruent
modulo n if (a mod n) = (b mod n)
– This is written as a = b(mod n)2
– Note that if a = 0(mod n), then n | a
23 = 8 (mod 5) because 23 - 8 = 15 = 5 * 3
- 11 = 5 (mod 8) because - 11 - 5 = - 16 = 8 * (- 2)
81 = 0 (mod 27) because 81 - 0 = 81 = 27 * 3
Modular Arithmetic
• Modular arithmetic exhibits the following properties:
11 mod 8 = 3; 15 mod 8 = 7
[(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2
(11 + 15) mod 8 = 26 mod 8 = 2
[(11 mod 8) - (15 mod 8)] mod 8 = - 4 mod 8 = 4
(11 - 15) mod 8 = - 4 mod 8 = 4
[(11 mod 8) * (15 mod 8)] mod 8 = 21 mod 8 = 5
(11 * 15) mod 8 = 165 mod 8 = 5
Table 4.2(a) Arithmetic Modulo 8
Table 4.2(b) Multiplication Modulo 8
Table 4.2(c)
Additive
and
Multiplicative Inverses
Modulo 8
Table 4.3
Properties of Modular Arithmetic for Integers in Z n
Table 4.4
Extended Euclidean Algorithm Example
For given integers a and b, find <d,x,y> satisfying: ax + by = d = gcd(a,b)
a
b
• (A2) Associative:
• a (b c) = (a b) c for all a, b, c in G
• (A5) Commutative:
• a b = b a for all a, b in G
Cyclic Group
• Exponentiation is defined within a group as a
repeated application of the group operator, so that
a3 = a a a
• We define a0 = e as the identity element, and a-n =
(a’)n , where a’ is the inverse element of a within the
group
• In essence, a ring is a set in which we can do addition, subtraction [a - b = a + (-b )], and
multiplication without leaving the set
Rings (cont.)
• A ring is said to be commutative if it satisfies
the following additional condition:
(M4) Commutativity of multiplication:
ab = ba for all a, b in R
• An integral domain is a commutative ring that
obeys the following axioms.
(M5) Multiplicative identity:
There is an element 1 in R such that a 1 = 1a = a
for all a in R
(M6) No zero divisors:
If a , b in R and ab = 0, then either a = 0 or b = 0
Fields
• A field F , sometimes denoted by {F, +,* }, is a set of elements with
two binary operations, called addition and multiplication, such that for
all a, b, c in F the following axioms are obeyed:
(A1–M6)
F is an integral domain; that is, F satisfies axioms A1 through A5 and M1
through M6
(M7) Multiplicative inverse:
For each a in F, except 0, there is an element a-1 in F such that aa-1 = (a-1 )a = 1
• In essence, a field is a set in which we can do addition, subtraction,
multiplication, and division without leaving the set. Division is defined
with the following rule: a /b = a (b-1 )
Familiar examples of fields are the rational numbers, the real numbers, and the
complex numbers. Note that the set of all integers is not a field, because not
every element of the set has a multiplicative inverse.
Group,
Ring,
and
Field
Finite Fields of the Form GF(p)
• Finite fields play a crucial role in many
cryptographic algorithms
• It can be shown that the order of a finite field
must be a power of a prime pn, where n is a
positive integer
• The only positive integers that are divisors of p are
p and 1
• The finite field of order pn is generally written
GF(pn )
• GF stands for Galois field, in honor of the
mathematician who first studied finite fields
Table 4.5(a) Arithmetic in GF(7)
Then:
f(x) + g(x) = x3 + 2x2 - x + 3
f(x) - g(x) = x3 + x + 1
f(x) * g(x) = x5 + 3x2 - 2x + 2
(a) Addition
Table 4.6(b) Arithmetic in GF(23)
(b) Multiplication
Table 4.6(c)
Arithmetic
in GF(23)
(a) Addition
(b) Multiplication
(a) Addition
(b) Multiplication