A PRESENTATION ON
“Modular Arithmetic”
By
Nikhil Sunil Patil
Class: T. Y. B. Tech –B
PRN: 201101131
Subject Name: Information Security (IS)
TA 1- Presentations
Department of Computer Engineering
R. C. Patel Institute of Technology, Shirpur
An Autonomous Institute
Modular Arithmetic :
modular arithmetic plays an important role in information security by providing a mathematical
framework for generating and verifying cryptographic keys, digital signatures, and other security-related
computations.
Figure : Modular arithmetic
Time-keeping on this clock uses arithmetic modulo 12. Adding 4 hours to 9 o'clock gives 1 o'clock, since
13 is congruent to 1 modulo 12.
1
Types of Modular Arithmetic :
1. Modular Addition :
In modular addition, two numbers are added together modulo a specified modulus. This type of modular
arithmetic is often used in cryptographic systems to combine two keys or to generate a new key from two
existing ones.
Expression : (a + b) mod n:
Example : Suppose we have two integers, a = 15 and b = 27, and we want to compute their sum modulo
n = 26:
=(a + b) mod n
= (15 + 27) mod 26
= 16
So the result of adding a and b modulo 26 is 16.
Similarly , Modular Subtraction also
Expression : (a – b) mod n .
2
2. Modular Multiplication :
In modular multiplication, two numbers are multiplied together modulo a specified modulus. This type of
modular arithmetic is often used in cryptographic systems to generate a secret key from a public key and
a random number
Expression : (a * b) mod n
Example : Suppose we have two integers, a = 7 and b = 13, and we want to compute their product
modulo n = 23
= (a * b) mod n
= (7 * 13) mod 23
= 18
So the result of multiplying a and b modulo 23 is 18.
Similarly , Modular Division also
Expression : (a / b) mod n.
.
3
3. Modular Exponentiation :
In modular exponentiation, a number is raised to a power modulo a specified.
Expression : a^b mod n
This expression represents the result of raising the integer a to the power of b, and then taking the
remainder when the result is divided by n. This is commonly used in modular exponentiation.
Example : Suppose we have an integer, a = 5, and we want to raise it to the power of b = 13
modulo n = 17 .
a^b mod n
= 5^13 mod 17
=4
So the result of raising 5 to the power of 13 modulo 17 is 4.
4
Properties Of Modular Arithmetic :
1. [(a mod n) + (b mod n)] mod n = (a + b) mod n
2. [(a mod n) - (b mod n)] mod n = (a - b) mod n
3. [(a mod n) x (b mod n)] mod n = (a x b) mod n
Examples :
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 ) x (15 mod 8)] mod 8= 21 mod 8 = 5
(11 x 15) mod 8 = 165 mod 8 = 5
5
References:
[1] Bruce Schneier, “Applied Cryptography, Protocols Algorithms and Source Code in C”,
Wiley. (Reference Book)
[2] William Stallings, “Cryptography and Network Security Principles and Practice”, 7th Edition,
Pearson Education, June 2017.( Text Book)
[3] https://www.slideserve.com/linore/modular-arithmetic (Online Slide server)
[4] https://en.wikipedia.org/wiki/Modular_arithmetic (Wikipedia)