0% found this document useful (0 votes)
4 views5 pages

sec 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

sec 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Faculty of Engineering – Semester 2024/2025

Department: Electronics and Electrical Communications Engineering


Lecturer: Dr. Nermeen Mohamed Abdalghafour
TA: Eng. Abdelrahman Shatat
Course: Data Security
Course Code: EEC 4126

Sheet # 1 Basics
Question #1: Using Fermat theory, find the following:
A)331 mod 7
B)235 mod 7
C)128129 mod 17
D)2925 mod 11
Fermat’s Theory:
𝑭𝒆𝒓𝒎𝒂𝒕′𝒔 𝑻𝒉𝒆𝒐𝒓𝒚

𝒂𝑷−𝟏 𝒎𝒐𝒅 𝑷 ≡ 𝟏 , 𝒂𝑷 𝒎𝒐𝒅 𝑷 ≡ 𝒂

If a is coprime with P.
A)331 mod 7
In this case, p = 7 and a = 3. Therefore, we have:
3(7-1) ≡ 1 (mod 7)
36 ≡ 1 (mod 7)
Now, we can use this result to evaluate 331 mod 7:
331 mod 7 = (330* 3) mod 7 = [( 36) 5 *3] mod 7 = [15* 3] mod 7 = 3 mod 7
Therefore, 331 mod 7is equal to 3.
B)235 mod 7
In this case, p = 7 and a = 2. Therefore, we have:
2(7-1) ≡ 1 (mod 7)
26 ≡ 1 (mod 7)
Now, we can use this result to evaluate 235 mod 7:
235 mod 7= [(26)5 mod 7* (25) mod 7]mod 7
= [15* 25] mod 7 = 25mod 7 = 32 mod 7 = 4
Therefore, 235 mod 7 is equal to 4.

C)128129 mod 17
In this case, p = 17 and a = 128. Therefore, we have:
128(17-1) ≡ 1 (mod 17)
12816 ≡ 1 (mod 17)
Now, we can use this result to evaluate 128129 mod 17:
128129 mod 17= [(12816)8 mod 17* (1281) mod 17]mod 17
= [18* (1281)] mod 17 = 128 mod 17 = 9
Therefore, 128129 mod 17 is equal to 9.
D)2925 mod 11
In this case, p = 11 and a = 29. Therefore, we have:
29(11-1) ≡ 1 (mod 11)
2910≡ 1 (mod 11)
Now, we can use this result to evaluate 2925 mod 11:
2925 mod 11= [(2910)2 mod 11* (295) mod 11] mod 11=
= [12* (295)] mod 11 = (295) mod 11 = [(𝟐𝟗𝟒 ) mod 11* (29) mod 11] = 3*7 mod 11
= 3 * 7 mod 11 = 21 mod 11 = 10
Therefore, 2925 mod 11 is equal to 10.

Question #2: Find the remainder of the division of a by 7.


a = 13954 * 6753 + 12 * 17 * 22

Firstly, attain the remainder of each term individually:


*)13954 mod 7= [1395 mod 7]4 = [2]4 mod 7=2
*)6753 mod 7= [675 mod 7]3 = [3]3 mod 7=6
*)12 mod 7= 5
*)17 mod 7=3
*)22 mod 7=1

Then, the remainder of the overall number is:


a mod 7= [13954 * 6753 + 12 * 17 * 22] mod 7
= [2*6+5*3*1]mod 7= [12+15]mod 7=27mod 7=6

Question #3: Using Euclidean algorithm, compute gcd (47, 7).


Euclide’s Algorithm:
It is used to calculate the GCD between two large values:
GCD (A, B) =GCD (A, B mod A), if A<B.

To find gcd (47, 7) using the Euclidean algorithm, we repeatedly divide the larger number
by the smaller number and take the remainder. The GCD is the last non-zero remainder.
Step 1: Divide 47 by 7: 47 ÷ 7 = 6 with a remainder of 5
gcd (47, 7) = gcd (47 mod 7, 7) =gcd (5, 7)
Step 2: Divide 7 by 5: 7 ÷ 5 = 1 with a remainder of 2
gcd (5, 7) = gcd (7 mod 5, 5) = gcd (2, 5)
Step 3: Divide 5 by 2: 5 ÷ 2 = 2 with a remainder of 1
gcd (2, 5) = gcd (5 mod 2, 2) = gcd (2, 1)
Step 4: Divide 2 by 1: 2 ÷ 1 = 2 with a remainder of 0
gcd (2, 1) = gcd (2 mod 1, 1) = gcd (0, 1) =1
Since the remainder is 0, the GCD is the last non-zero remainder, which is 1.
Therefore, gcd (47, 7) = 1.
This means that 47 and 7 are relatively prime, meaning they have no common factors
other than 1.
Question #4: Find the remainder of the division of 34565 by 13.
Using Fermat’s Theory:
Fermat’s Theory:
𝑭𝒆𝒓𝒎𝒂𝒕′𝒔 𝑻𝒉𝒆𝒐𝒓𝒚

𝒂𝑷−𝟏 𝒎𝒐𝒅 𝑷 ≡ 𝟏 , 𝒂𝑷 𝒎𝒐𝒅 𝑷 ≡ 𝒂

If a is coprime with P.

In this case, p = 13 and a = 3. Therefore, we have:


3(13-1) ≡ 1 (mod 13)
3(12) ≡ 1 (mod 13)
Now, we can use this result to find the remainder of 34565 divided by 13:
34565 mod 13 = [(312) 380 * (35)] mod 13 = [(1) 380 * (35)]mod 13 = 35mod 13
= 243 mod 13 = 9
Therefore, the remainder of the division of 34565 by 13 is 9.

Question #5: Find the last digit of 7100 in case of decimal expansion.

The last digit in the decimal expansion of 7100


To evaluate the last decimal digit in any number we will divide it by 10, and the residue of
the division will always be equal to the last digit.
Ex:4963÷10=496.3
Remainder=4963 - 10*496=3 → (= 4963 mod 10=3)
So, the last decimal digit= 7100 mod 10
Since 7&10 are co-prime,
Euler’s Theory:
𝐸𝑢𝑙𝑒𝑟′𝑠 𝑇ℎ𝑒𝑜𝑟𝑦

𝑎𝜑(𝑛) 𝑚𝑜𝑑 𝑛 ≡ 1 , 𝑎𝜑(𝑛)+1 𝑚𝑜𝑑 𝑛 ≡ 𝑎

If a & n are co-prime.


𝟕𝛗(𝟏𝟎) 𝐦𝐨𝐝 𝟏𝟎 ≡ 𝟏
φ(10) = 1 ∗ 4 = 4
𝟕𝟒 𝐦𝐨𝐝 𝟏𝟎 ≡ 𝟏
100=4*25
4 25
((7 ) ) mod 10 = 1 =the last digit in the decimal expansion.

Question #6: Find the remainder of the division of a by 56.


a = 53 * 47 * 51 * 43
Firstly, divide these number into two groups (53 * 47, 51 * 43) attain the remainder
of each group individually:
*) (53 * 47) mod 56= (2491) mod 56 =27
*) (51 * 43) mod 56= (2193) mod 65 = 9
Then, calculate remainder of the overall number = (27*9) mod 56=19
Question #7: Find the remainder of the division of 4569 by 89.

By dividing the power of 4569, we have:


45(3) ≡ 78 (mod 89)
45(6) ≡ 78(2) (mod 89) =32
45(12) ≡ 32(2) (mod 89) =45 (again we returned to the initial value)

The overall power=69=12*5+9


4569 mod 89= [(𝟒𝟓𝟏𝟐 )𝟓 *𝟒𝟓𝟗 ]mod 89; (𝟒𝟓𝟏𝟐 )mod 89=45

= [(𝟒𝟓)𝟓*𝟒𝟓𝟗 ]mod 89= [(𝟒𝟓)𝟏𝟒 ]mod 89= [(𝟒𝟓)𝟏𝟐*𝟒𝟓𝟐 ]mod 89= [45*𝟒𝟓𝟐 ]mod 89
45(3) ≡ 78 (mod 89) =78

Question #8: Given that 5x ≡ 6 (mod 8), find x. (Report)


Question #9: Complete the addition and the multiplication tables modulo 6.

Firstly, Calculate the value of each element in the given tables:


Add. 0 1 2 3 4 5 Mult. 0 1 2 3 4 5
0 0 1 2 3 4 5 0 0 0 0 0 0 0
1 1 2 3 4 5 6 1 0 1 2 3 4 5
2 2 3 4 5 6 7 2 0 2 4 6 8 10
3 3 4 5 6 7 8 3 0 3 6 9 12 15
4 4 5 6 7 8 9 4 0 4 8 12 16 20
5 5 6 7 8 9 10 5 0 5 10 15 20 25

Then, calculate the modulo of the result in each cell as follows:


Add. 0 1 2 3 4 5 Mult. 0 1 2 3 4 5
0 0 1 2 3 4 5 0 0 0 0 0 0 0
1 1 2 3 4 5 0 1 0 1 2 3 4 5
2 2 3 4 5 0 1 2 0 2 4 6→0 8→2 (10→4)
3 3 4 5 0 1 2 3 0 3 6→0 9→3 12→0 15→3
4 4 5 0 1 2 3 4 0 4 8→2 12→0 16→4 20→2
5 5 0 1 2 3 4 5 0 5 10→4 15→3 20→2 25→1

Question #10: Using Euler theorem, what is the remainder of 192200002 modulo 23?
Euler’s Theory:
𝑬𝒖𝒍𝒆𝒓′𝒔 𝑻𝒉𝒆𝒐𝒓𝒚

𝒂𝝋(𝒏) 𝒎𝒐𝒅 𝒏 ≡ 𝟏 , 𝒂𝝋(𝒏)+𝟏 𝒎𝒐𝒅 𝒏 ≡ 𝒂

If a & n are co-prime.


Here we have a=19 & n=23, which are co-prime.
𝛗(𝐧) = 𝛗(𝟐𝟑) = (𝟐𝟑 − 𝟏) = 𝟐𝟐 →
𝟏𝟗𝟐𝟐 𝐦𝐨𝐝 𝟐𝟑 ≡ 𝟏
2200002=𝟏𝟎𝟓 ∗ 𝟐𝟐 + 𝟐
𝟓
192200002 modulo 23= [(𝟏𝟗𝟐𝟐 )𝟏𝟎 *𝟏𝟗𝟐 ]mod 23
= [1*𝟏𝟗𝟐 ] mod 23=16

════ஜ End of Sheet ஜ════


Good Luck

You might also like