Showing posts with label Zn. Show all posts
Showing posts with label Zn. Show all posts

Saturday, May 27, 2017

Cryptography: Why is Zn not a Field?


The main reason for why, in general, Zn is only a commutative ring and not a finite field is because not every element in Zn is guaranteed to have a multiplicative inverse.

In particular, as shown before, an element a of Zn does not have a multiplicative inverse if a is not relatively prime to the modulus n.

What if we choose the modulus n to be a prime number?

A prime number has only two divisors, one and itself.


Cryptography: Zn is more than a commutative ring, but not quite an integral domain. Why?

Because Zn contains a multiplicative identity element. Commutative rings are not required to possess multiplicative identities.

Why is Zn not an integral domain?
Even though Zn possesses a multiplicative identity, it does NOT satisfy the other condition of integral domains which says that if a × b = 0 then either a or b must be zero.
Consider modulo 8 arithmetic. We have 2 × 4 = 0, which is a clear violation of the second rule for integral domains.

Cryptography: Zn is a commutative ring. Why?

Because the set of all integers under operations of arithmetic addition and multiplication is commutative ring

Thursday, April 20, 2017

Cryptography: Properties of Modular Arithmetic: Set Zn


For arithmetic modulo n, let Zn denote the set
    Zn = {0, 1, 2, 3, ....., n−1}
Zn is the set of remainders in arithmetic modulo n. It is officially called the set of residues.
Let’s now consider the set Zn along with the following two binary operators defined for the set:
1.modulo n addition; and
2.modulo n multiplication.
The elements of Zn obey the following properties:
For every element of Zn, there exists an additive inverse in Zn. But there does not exist a multiplicative inverse for every non-zero element of Zn.
The multiplicative inverses exist for only those elements of Zn that are relatively prime to n.
Two integers are relatively prime to each other if the integer 1 is their only common positive divisor.
More formally, two integers a and b are relatively prime to each other if gcd(a, b) = 1 where gcd denotes the Greatest Common Divisor.
The following property of modulo n addition is the same as for ordinary addition:
  (a + b) ≡ (a + c)(mod n) implies b ≡ c (mod n)
  ((-a) + a + b) ≡ ((-a) + a + c)(mod n)
     b c (mod n)
(5 + 23) (5 + 7)(mod8); 23 7(mod8)
But a similar property is NOT obeyed by modulo n multiplication. That is
(a × b) ≡ (a × c)(mod n) does not imply b ≡ c(mod n)
unless a and n are relatively prime to each other.
  ((a-1)ab) ((a-1)ac)(mod n)
    b c(mod n)
The integers 6 and 8 are not relatively prime, since they have the common factor 2.
6 * 3 = 18 ≡ 2(mod 8)
6 * 7 = 42 ≡ 2(mod 8)
Yet 3 ≢ 7 (mod 8)