Posts

Showing posts with the label Cryptography

Euler's Totient Theorem: The Secret World of Modular Exponents

Welcome back to izytech.dev ! In our previous article , we discovered how to simulate division using the Multiplicative Inverse and the Euclidean Algorithm. However, we left a huge question unanswered about modular exponentiation. We know how to calculate giant powers, but we learned a strange rule: the exponent does not live in the same modular world as the base . If the base lives in a mod N world, where does the exponent live? Today, we are going to explore this "parallel universe" and introduce the mathematical magic trick behind modern encryption: Euler's Totient Theorem . The Totient: A Parallel World To understand exponents in modular arithmetic, we must introduce a new concept called the Totient (often represented by the Greek letter Phi, Φ(N) ). The totient of a positive integer N is simply the count of positive integers that are strictly less than N and are relatively prime to N (meaning they share no common prime factors with N...

Modular Exponentiation: How "Square and Multiply" Powers Modern Cryptography

Welcome back to izytech.dev ! In the previous article , we found out how to simulate division in modular arithmetic using the Multiplicative Inverse and the ancient Euclidean Algorithm. Now that we know how to add, multiply, and "divide" numbers safely, we're facing the biggest obstacle of all: powers . In modern cryptography, encrypting and decrypting a message means taking a number (the message) and raising it to a massive power (the key) inside a modular world. But how do computers handle numbers that huge without crashing? The Problem With Giant Numbers When we're working with small numbers, exponentiation is easy. Calculating 3 to the 5th power (3 5 ) in a "modulo 143" world can even be done by hand or with a basic calculator, just by reducing the final result. But what happens if we need to calculate 12,345 raised to the 6,789th power , still modulo 143? We're talking about a number with tens of thousands of digits! Regu...

The Multiplicative Inverse and Euclid's Algorithm: How to "Divide" in Cryptography

Welcome back to izytech.dev ! In the previous article , we looked at the beating heart of cryptography: modular arithmetic. We saw how computers use the math of "remainders" to keep numbers small and calculations fast. But we ended that lesson with a big roadblock: in this circular world, division doesn't exist . So if we can't divide a number to decrypt a message, how do we go back? The answer lies in one of the most fascinating ideas in number theory: the Multiplicative Inverse , along with an algorithm that's thousands of years old and still lets us calculate it today. The Illusion of Division Think about regular math for a second. Dividing a number by 5 is exactly the same as multiplying it by 1/5 (its reciprocal). In cryptography, we use this exact same logic, but since we can't work with decimals or fractions, we need to find a whole number that behaves just like that reciprocal. This special number is called the multiplicativ...

Modular Arithmetic in Cryptography: The Engine of Digital Security

Welcome back to izytech.dev ! In the previous article , we looked at why mathematical precision matters and how prime numbers and the Greatest Common Divisor are the building blocks of computer security. Today we take an important step forward and introduce the most important working tool of this field: Modular Arithmetic . If the concepts from the first lesson were the building materials, modular arithmetic is the real engine that powers modern cryptographic algorithms. Let's see how it works and why we use it every day, often without even noticing. What Is Modular Arithmetic? (The Math of the Clock) In simple terms, modular arithmetic is the math of remainders . Instead of moving along an infinite number line, we work inside a limited, cyclical system, focusing only on what is left over after a normal division by a specific number, called the modulus . A practical example we all use is reading a clock. Let's say it's 14:30 and you need to leave...

The Mathematical Foundations of Modern Cryptography: Exactness, Prime Numbers, and the Greatest Common Divisor

Welcome to the first post of this blog, dedicated to my academic journey in cryptography. The goal of this post is to introduce the fundamental mathematical concepts that guarantee the security of our digital communications. It is important to underline that the mathematics used in cryptography is profoundly different from what we apply in our daily routines. The absolute need for exactness In everyday life, the use of approximations is very common. For example, if a product costs $1.99, we naturally consider it as $2.00. However, in the field of modern cryptography, there is no tolerance for rounding errors. If a cryptographic algorithm approximates a value even by a microscopic fraction, the entire system fails. The digital "key" used to encrypt a message would no longer be able to decrypt it, making the information permanently inaccessible. For this reason, cryptography abandons decimal numbers and operates exclusively with integers (such as -1,...