MSC2050 Discrete Mathematics, Presentation 7: Dr. Anna Tomskova
MSC2050 Discrete Mathematics, Presentation 7: Dr. Anna Tomskova
spring 2024
Version 1.0 typed under LATEX
ax ≡ b (mod m),
Theorem
If a and m are relatively prime integers and m > 1, then an inverse of a modulo
m exists.
Furthermore, this inverse is unique modulo m (any othe inverse is congruent to
this one modulo m).
Answer Q2
This puzzle can be translated into the following question: What are the solutions
of the systems of congruences
x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
x ≡ 2 (mod 7)?
Solution: x = 3t + 2 =⇒ 3t + 2 ≡ 3 (mod 5) =⇒ 3t ≡ 1 (mod 5).
Since 2 is an inverse of 3 modulo 5, t ≡ 2 (mod 5). So t = 5u + 2 and so
x = 15u + 8.
15u + 8 ≡ 2 (mod 7) =⇒ 15u ≡ −6 (mod 7) =⇒ 15u ≡ 1 (mod 7).
Since 1 is an inverse of 15 modulo 7, u ≡ 1 (mod 7). So u = 7v + 1 and so
x = 105v + 23 and so x ≡ 23 (mod 105).
Theorem
Let m1 , m2 , . . . , mn be pairwise relatively prime positive integers greater than one
and a1 , a2 , . . . , an arbitrary integers. Then the system
x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
..
.
x ≡ an (mod mn )
has a unique solution modulo m = m1 m2 · · · mn .
Suppose that performing arithmetic with integers less than 100 on a certain
processor is much quicker than doing arithmetic with larger integers.
For example, we can use the moduli of 99, 98, 97, and 95.
By the Chinese remainder theorem, every non-negative integer less than
99 · 98 · 97 · 95 = 89, 403, 930 can be represented uniquely by its remainders when
divided by these four moduli.
We represent 123, 684 as (33, 8, 9, 89), 413, 456 as (32, 92, 42, 16).
We find 123, 684 + 413, 456 = (33, 8, 9, 89) + (32, 92, 42, 16) =
(65 mod 99, 100 mod 98, 51 mod 97, 105 mod 95) = (65, 2, 51, 10).
Next solve the system of congruences
x ≡ 65 (mod 99)
x ≡ 2 (mod 98)
x ≡ 51 (mod 97)
x ≡ 10 (mod 95).
Theorem
If p is prime and a is an integer not divisible by p, then ap−1 ≡ 1 (mod p).
Furthermore, for every integer a we have ap ≡ a (mod p).
Note that Fermat’s Little Theorem is not applicable to find 1755 mod 111 and
14222 mod 7.
Answer Q3
Solution: First note that the hashing function h(k) = k mod 111 maps the Social
Security number 107405723 to location 14, because
h(107405723) = 107405723 mod 111 = 14.
However, this location is already occupied (by the file of the customer with
number 064212848).
But, because memory location 15, the first location following memory location 14,
is free, we assign the record of the customer with Social Security number
107405723 to this location.
ek (x) = (x + k) mod m
dk (y) = (y − k) mod m.
Cryptographic functions must be one-to-one (why?).
Clearly, the Caesar cipher is insecure-the key space is only as large as the alphabet.
An alternative (though still not secure) is what is known as an affine cipher.
All classical ciphers, including shift and affine ciphers, are private
key cryptosystems.
Knowing the encryption key allows one to quickly determine the
decryption key.
All parties who wish to communicate using a private key
cryptosystem must share the key and keep it a secret.
In public key cryptosystems, first invented in the 1970s, knowing
how to encrypt a message does not help one to decrypt the
message.
Therefore, everyone can have a publicly known encryption key.
The only key that needs to be kept secret is the decryption key.
Encrypt the message “STOP” using the RSA cryptosystem with key
(2537, 13).
We encrypt each block using the mapping f (x) = x13 mod 2537.
Answer Q5