Computer Applications of Number Theory
Computer Applications of Number Theory
INTRODUCTION
Number theory is the pure branch of mathematics that study the properties and relationships of positive integers. It
explores patterns, structures, and properties of numbers and seeks to understand their fundamental properties and
behaviors. Carl Friedrich Gauss (1777–1855) said, "Mathematics is the queen of the sciences—and number theory is the
queen of mathematics."
Examples of number theory:
Example 1: Find the value of (23*25).
Solution:-
23 × 25 = 2(3+5) = 28
https://academicajournal.com/IJMTCSI
International Journal of Mathematical Theory and Computer Science Issues Vol: 1, No 2, 2024 10 of 14
A linear congruence is an equivalence connection between two integers, a and b, with respect to a certain positive integer,
m. A is congruent to b modulo m if and only if their difference is exactly proportional to m, or equivalently, if their
remainder upon division by m is equal. This can be expressed as a ≡ b (mod m) (Rosen, 2008; Niven, Zuckerman, &
Montgomery, 2019; Burton, 2011). An equivalence relation on an algebraic object that is compatible with the algebraic
structure is called a linear congruence (Barendregt, 1990). This means that the operations are explicably stated in the
equivalence classes.
A key idea in number theory, linear congruence has many uses in computer technology. This idea is based on a unique
relationship that exists between two integers depending on a particular modulus. In computer science, linear congruence
has a wide range of applications.
An expression ax≡b (mod m),
Where,
a≢0 (mod m) i.e. m⌿a-0 = m⌿a, is called a linear congruence.
ax≡b (mod m) ------- (1)
If x0 is solution of (1)
Then,
ax0≡b(mod m)
4x=3(mod 5) is a linear congruence.
Where a=4, b=3, m=5
If x=1,
4≡3(mod 5) = 5/(4-3) = 5/1, which is not true.
If x=2,
4*2≡(mod 5) = 5/(8-3) = 5/5, which is true.
Hence, x=2 is the solution of linear congruence.
A comprehensive and quantitative examination of the subject has been established by reviewing and citing
several publications and related studies from general references, books, journals, and online sources. Every topic is
presented in an organized and illustrative manner to make it easy for readers in general and students to understand what
is being addressed. Experts in the field and academic colleagues were approached to help make concepts in the research
study more intelligible so that the issue may be presented in a more straightforward and concise manner.
.
RESULTS AND DISCUSSION
This section discusses and provides instances of how number theory is applied in the field of cryptography to linear
congruence using the RSA system; translating decimal numbers to binary, octal, or hexadecimal; using hamming codes
for error detection; and employing hashing functions.
https://academicajournal.com/IJMTCSI
International Journal of Mathematical Theory and Computer Science Issues Vol: 1, No 2, 2024 11 of 14
This section will apply the linear congruence method described earlier to the encryption and decryption of a message
utilising the RSA system in certain sections.
The prime numbers a and b serve as the private key for the RSA (Rivest Shamir Adleman) system, a private key
cryptosystem that also uses the ciphertext C = Ne (mod m), number n (the product of a and b), and number e (a number
comparatively prime to (a-1)(b-1)).
A trapdoor function is used by the RSA cryptosystem. Without additional information, trapdoor functions are very
difficult to compute in the opposite way than they are in the first.
Since exponentiation and modulo operations are all that are needed, encryption direction is quite
simple.
3. Due to the requirement for prime factorization, which increases the security of the RSA, decryption without the
private key is exceedingly difficult.
Example
A. Encryption of Message
Encrypt the message “HELLO” using RSA with m = 77 and e = 5.
1. Use an integer to represent the message. H=08 E=05 L=12 L=12 0=15
2 Sorting the numbers in the sequence N = 08 05 12 12 15
3. Use C = N5 (mod 77) encryption for every block.
• the initial block: 085 (mod 77)=32
• Block two: 055 (mod 77) = 55
• Block three: 125 (mod 77) = 62
• Block four: 125 (mod 77) = 62
• Block five: 155 (mod 77) = 63
Encryption code: 3255626263
B. Decryption of Message
Now, let’s decrypt the encryption code 32 55 62 62 63 using a=7, b=1111, and e=5
1. d modular inverse of e mod (a-1)(b-1)
(a-1)(b-1)= 6*10= 60
Solve d where 5d=1 (mod 60)
2. Find by applying Euclidean algorithm:
d=29
then, 5*29= 1 (mod 60)
3 Using d modulo m, decrypt the provided block.
For H, 08= 3229 (mod 77)
For E, 05=5529 (mod 77)
For L, 12=6229 (mod 77)
For L, 12=6229 (mod 77)
For O, 15=6329 (mod 77)
Decrypted code: 0805121215
Which translate back into HELLO
Application of linear congruence to converting from decimal numbers to binary, octal, and hexadecimal number system.
https://academicajournal.com/IJMTCSI
International Journal of Mathematical Theory and Computer Science Issues Vol: 1, No 2, 2024 12 of 14
In computer science and programming, the conversion of numbers from different form to binary, octal, and hexadecimal
is not a simple deal. We use different bases for these numbering systems to express numerical values. Long decimal
values are difficult to mentally convert to binary, octal, or hexadecimal systems. Hexadecimal numbers have sixteen (0–
F), octal numbers have eight, binary numbers only have two (0–1), and the decimal numbering system allows each digit
to have a value of one of ten (0–9) (Henry-Stocker, 2022).
Whole decimal numbers must be divided by two to convert them to binary numbers with base two; the binary number
reading from bottom to top is represented by the remainders of this division (𝑚𝑜𝑑 2).
Similarly, use (𝑚𝑜𝑑 8) to convert the entire decimal number to an octal one, that is, with base 8.
Similar procedures apply when converting full decimal integers to hexadecimal, or base 16 using (𝑚𝑜𝑑 16), in which
case the digits after 9 are substituted with 10 = 𝐴, 11 = 𝐵, 12 = 𝐶, 13 = 𝐷, 14 = 𝐸, 𝑎𝑛𝑑 15 = 𝐹.
𝑛 = 𝑏𝑞0 + 𝑎0, 0 ≤ 𝑎0 ≤ 𝑏
Example: To convert the decimal number (23443)10 into an octal number, so (𝑚𝑜𝑑 8).
23443= 8. 2930+3
2930= 8. 366+2
366= 8. 45+6
45= 8. 5+5
5= 8. 0+5
A crucial component of computer technology that allows machines to do tasks in a matter of seconds is the number
system. A wide range of computer and digital technology sectors and applications make considerable use of the three
widely used number systems: binary, octal, and hexadecimal. Therefore, converting numbers across different systems is
essential. By applying linear congruence to resolve these problems, our analysis showed how successful this conversion
is.
To create a 7-bit code, take a look at a Hamming code that has 4 data bits (D1=1, D2=0, D3=1, D4=1) and 3 parity bits
(P1, P2, P3). Congruence mod 2 is used to determine the parity bits:
P1 covers bits that have 1 as the least significant bit in their position index, which are positions 1, 3, 5, and 7:
𝑃 1 ≡𝐷 1 + 𝐷 2 + 𝐷 4 (m o d 2).
P1 = D1 + D2 + D4 (mod 2)
𝑃 1 ≡ 1 + 0 + 1 ≡ 0 (m o d 2).
P1≡1+0+1≡0(mod 2)
P2 includes bits that have a 1 in the second position of their binary index at places 2, 3, 6, and 7:
𝑃 2 = 𝐷 1 + 𝐷 3 + 𝐷 4 (m o d 2).
P2 = D1 + D3 + D4 (mod 2)
𝑃 2 = 1 + 1 + 1 = 1 (m o d 2).
P2 = 1+1+1 = 1 (mod 2)
P3 includes bits that have a 1 in the third position of their binary index at places 4, 5, 6, and 7:
𝑃 3 ≡𝐷 2 + 𝐷 3 + 𝐷 4 (m o d 2).
https://academicajournal.com/IJMTCSI
International Journal of Mathematical Theory and Computer Science Issues Vol: 1, No 2, 2024 13 of 14
P3 = D2 + D3 + D4 (mod 2)
𝑃 3 ≡ 0 + 1 + 1 ≡ 0 (m o d 2).
P3≡0+1+1≡0(mod2)
Let's say that there is a mistake in bit 5, causing the received data to change to 0110111. We use congruence mod 2 to
compute the parity bits in order to find the error:
P1': 0 + 1 + 1 + 1 ≡ 1 (m o d 2).
P2': 1 + 1 + 1 + 1 ≡ 0 (m o d 2).
P3': 0 + 1 + 1 + 1 ≡ 1 (m o d 2).
The symptom of 101 (binary for position 5) indicates that bit 5 is where the issue is. We flip a bit five to repair it, bringing
the original data back to 0110011.
Congruence mod 2 is used in Hamming Codes to calculate parity bits by making sure that the total of a given set of data
bits plus parity bits is equal to zero. Single-bit errors can be found and their location can be determined for rectification
during data transmission with the use of this modular arithmetic technique.
HASHING FUNCTION:
Any function that converts data of any size to data of a predetermined size is called a hash function. It is utilized in
encryption to guarantee the integrity of data that is transferred and in HMACs to offer message authentication.
1. Locate the memory locations that the insurance company's records with these social security numbers are given by the
hashing function h(k) = k mod 101.
104578690
Solution:
consider,
104578690 mod 101.
101 (x) = 104578690
We must divide 101 by 104578690.
= 1035432.574
Multiplying the previous number by 101 yields: 101(1035432) + 58
Therefore,
104578690 mod 101=58
432222187
solution:
432222187 mod 101
432222187 ≡ 101 (x)
432222187 divided by 101.
We get,
4279427.594 = 432222187/101.
By Subtracting =4279427.594-4279427
=0.5940594.
Next, multiplying 101 by 0.5940594
=59.9999994.
Here,
432222187 = 101(4279427) + 60
Therefore,
432222187 mod 101 = 60
A hash function should have a number of characteristics, such as being easily computable and distributing objects among
all value addresses in an equitable manner. For this reason, m is typically selected to be a prime number. We can state
that every bit of a key is necessary for a hash function to function. It needs to be a surjective onto function.
Hashing is so useful because many Computer language support hashing like (perl, Lisp, Python).
https://academicajournal.com/IJMTCSI
International Journal of Mathematical Theory and Computer Science Issues Vol: 1, No 2, 2024 14 of 14
CONCLUSION
In this paper, We have attempted to explain a few number theory applications, including linear congruence. We have also
attempted to identify knowledge gaps that the theories might be able to fill in order to handle various difficulties, as well
as to create connections and interconnections between these approaches and theoretical frameworks.
Thus, we have demonstrated several strong expansions and uses of linear congruence in this brief study. Here, we covered
the use of linear congruence in the field of cryptography using the RSA system as well as its applications in the conversion
of decimal integers to binary, octal, and hexadecimal. We have also discussed the error detection by Hamming code and
Hashing function with illustrative example in this paper.
Numerous branches of mathematics and computer science have found inspiring applications for the problems this paper
solves. The solutions are highly amazing.
REFERENCES
1. Barendregt, H. (1990). Functional Programming and Lambda Calculus". In Jan van Leeuwen (ed.).
Formal Models and Semantics. Handbook of Theoretical Computer Science, 321–364.
2. Rosen, K.H. (2008). Discrete Mathematics and Its Applications. McGraw-Hill Education. Schneier, B.
(1996). Applied Cryptography. John Wiley & Sons.
3. M. CUARTO(2014), Algebraic Algorithm for solving linear congruence: Its application to cryptography.
Asia Pacific Journal of Education, Arts and Science Vol:1 No:1
4. Orhani, S. & Çeko, B. (2023). Some applications of linear congruence from number theory. International
Research Journal of Science, Technology, Education, and Management, 3(2), 1-11.
5. Henry-Stocker, S. (2022). Converting numbers on Linux among decimal, hexadecimal, octal, and binary.
Network World
https://academicajournal.com/IJMTCSI