top of page
Inaugurated by IN-SPACe
ISRO Registered Space Tutor

S3-SA4-0210

What is the Use of Number Theory in Cryptography?

Grade Level:

Class 8

AI/ML, Data Science, Physics, Economics, Cryptography, Computer Science, Engineering

Definition
What is it?

Number theory is a branch of mathematics that studies whole numbers and their properties. In cryptography, it's used to create strong codes and ciphers that keep our digital information safe and private, like when you send a message or make an online payment.

Simple Example
Quick Example

Imagine you want to send a secret message to your friend using a special code. Number theory helps create a 'lock' for your message and a 'key' for your friend. For example, if you multiply two very large prime numbers (numbers only divisible by 1 and themselves), it's very hard for anyone else to figure out the original numbers, making it a strong 'lock' for your secret.

Worked Example
Step-by-Step

Let's say we want to create a simple 'shared secret' using a concept from number theory called modular arithmetic, which is like a clock.

Step 1: Both you and your friend agree on a common large prime number, say 17, and a base number, say 3.
---
Step 2: You choose a secret number, let's say 5. You calculate (3^5) mod 17.
3^5 = 243.
243 divided by 17 gives a remainder of 5. So, you send 5 to your friend.
---
Step 3: Your friend chooses a secret number, let's say 7. Your friend calculates (3^7) mod 17.
3^7 = 2187.
2187 divided by 17 gives a remainder of 15. So, your friend sends 15 to you.
---
Step 4: Now, you take the number your friend sent (15) and raise it to your secret number (5), then find the remainder when divided by 17: (15^5) mod 17.
15^5 = 759375.
759375 divided by 17 gives a remainder of 1.
---
Step 5: Your friend takes the number you sent (5) and raises it to their secret number (7), then find the remainder when divided by 17: (5^7) mod 17.
5^7 = 78125.
78125 divided by 17 gives a remainder of 1.
---
Step 6: Both of you have arrived at the same secret number, 1, without directly sharing your individual secret numbers (5 and 7). This shared secret (1) can then be used to encrypt or decrypt messages. This is a simplified version of how the Diffie-Hellman key exchange works.

Answer: The shared secret is 1.

Why It Matters

Understanding number theory is crucial for designing secure digital systems, protecting our privacy online, and ensuring safe transactions. Careers in cybersecurity, data science, and computer engineering heavily rely on these principles to build everything from secure messaging apps to banking systems. It's how your UPI payments stay safe!

Common Mistakes

MISTAKE: Thinking cryptography is only about hiding messages with simple letter-swapping. | CORRECTION: Cryptography uses advanced mathematical concepts, especially from number theory, to create highly complex and secure codes that are very difficult to break.

MISTAKE: Believing that any large number can be used effectively in cryptographic algorithms. | CORRECTION: Cryptography often relies on specific types of numbers, like very large prime numbers, because their unique properties (like being hard to factor) make the codes strong.

MISTAKE: Confusing 'coding' (like computer programming) with 'encoding' (like cryptography). | CORRECTION: While both involve instructions, coding is about writing software, whereas encoding in cryptography is specifically about transforming information to protect it from unauthorized access, often using number theory.

Practice Questions
Try It Yourself

QUESTION: If two people agree on a prime number 11 and a base 2. If one person chooses a secret number 3, what number would they send to the other person using (base^secret) mod prime? | ANSWER: (2^3) mod 11 = 8 mod 11 = 8. They would send 8.

QUESTION: Why are prime numbers considered very important in cryptography? Give one reason. | ANSWER: Prime numbers are important because it is extremely difficult and time-consuming for computers to find the prime factors of a very large composite number. This 'difficulty' forms the basis of many secure encryption methods.

QUESTION: Imagine a very simple encryption where you multiply your message number by a 'key' and then find the remainder when divided by 13. If your message number is 5 and your key is 7, what is the encrypted message? If the receiver knows the key is 7, how might they try to 'undo' this? | ANSWER: Encrypted message: (5 * 7) mod 13 = 35 mod 13 = 9. The receiver would need to find a number (let's call it the decryption key) that when multiplied by 7 and then by 9, gives a remainder of 5 when divided by 13. This involves finding the modular inverse of 7 modulo 13. (For 7, the inverse is 2, since (7*2) mod 13 = 14 mod 13 = 1. So, (9*2) mod 13 = 18 mod 13 = 5, which is the original message.)

MCQ
Quick Quiz

Which property of large prime numbers makes them useful in cryptography?

They are easy to add together quickly.

It is very hard to find their prime factors.

They are always even numbers.

They have very few digits.

The Correct Answer Is:

B

The difficulty of factoring very large numbers (finding their prime components) is the backbone of many cryptographic algorithms, making it hard for unauthorized parties to break the code. Options A, C, and D are incorrect properties or irrelevant to their cryptographic strength.

Real World Connection
In the Real World

When you use WhatsApp, your messages are protected by 'end-to-end encryption.' This security relies heavily on number theory, specifically on concepts like prime numbers and modular arithmetic, to create unique digital keys for you and your friend. Similarly, when you make a payment using UPI, number theory ensures that your transaction details are scrambled and sent securely, preventing anyone from stealing your money or information.

Key Vocabulary
Key Terms

CRYPTOGRAPHY: The art of writing and solving codes to protect information | NUMBER THEORY: The branch of mathematics that studies whole numbers and their properties | PRIME NUMBER: A whole number greater than 1 that has no positive divisors other than 1 and itself | MODULAR ARITHMETIC: A system of arithmetic for integers, where numbers 'wrap around' upon reaching a certain value (the modulus), like a clock | ENCRYPTION: The process of converting information or data into a code, especially to prevent unauthorized access

What's Next
What to Learn Next

Now that you've seen how number theory helps keep your secrets safe, you can explore more advanced topics like 'Public Key Cryptography' and 'RSA Algorithm.' These concepts build directly on what you've learned and show how these mathematical ideas are used in real-world secure communication.

bottom of page