Posts

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...

Esponenziazione Modulare: Come Gestire Numeri Giganti in Crittografia

Bentornati su izytech.dev ! Nel precedente articolo abbiamo scoperto come simulare la divisione in aritmetica modulare utilizzando l'Inverso Moltiplicativo e l'antico Algoritmo di Euclide. Ora che sappiamo sommare, moltiplicare e "dividere" i numeri in modo sicuro, ci troviamo di fronte all'ostacolo più grande di tutti: le potenze . Nella crittografia moderna, cifrare e decifrare un messaggio significa prendere un numero (il messaggio) ed elevarlo a una potenza colossale (la chiave) all'interno di un mondo modulare. Ma come fanno i computer a gestire numeri così incredibilmente grandi senza andare in crash? Il problema dei numeri giganteschi Se lavoriamo con numeri piccoli, l'esponenziazione è semplice. Calcolare 3 elevato alla 5a potenza (3 5 ) in un mondo "modulo 143" si può fare anche a mente o con una normale calcolatrice, riducendo semplicemente il risultato finale. Ma cosa succede se dobbiamo calcolare 12.345 el...

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...

L'Inverso Moltiplicativo e l'Algoritmo di Euclide: Come "Dividere" in Crittografia

Bentornati su izytech.dev ! Nel precedente articolo abbiamo esplorato il cuore pulsante della crittografia: l'aritmetica modulare. Abbiamo visto come i computer utilizzino la matematica dei "resti" per mantenere i numeri piccoli e i calcoli ultra-veloci. Tuttavia, avevamo concluso la lezione con un grosso ostacolo: in questo mondo circolare, la divisione non esiste . Se non possiamo dividere un numero per decifrare un messaggio, come facciamo a tornare indietro? La risposta risiede in uno dei concetti più affascinanti della teoria dei numeri: l' Inverso Moltiplicativo e un algoritmo vecchio di millenni che ci permette di calcolarlo. L'Illusione della Divisione Pensate alla matematica tradizionale. Dividere un numero per 5 è esattamente la stessa cosa che moltiplicarlo per 1/5 (il suo reciproco). In crittografia, usiamo la stessa identica logica, ma poiché non possiamo usare i numeri decimali o le frazioni, dobbiamo trovare un numero intero...

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...

L'Aritmetica Modulare in Crittografia: Il Motore della Sicurezza Digitale

Bentornati su izytech.dev ! Nel precedente articolo abbiamo esplorato l'importanza dell'esattezza matematica e di come i numeri primi e il Massimo Comune Divisore costituiscano i mattoni fondamentali della sicurezza informatica. Oggi facciamo un passo avanti decisivo introducendo lo strumento operativo più importante di questa disciplina: l' Aritmetica Modulare . Se i concetti visti nella prima lezione rappresentano i materiali da costruzione, l'aritmetica modulare è il vero motore matematico che fa girare gli algoritmi crittografici moderni. Scopriamo insieme come funziona e perché la usiamo costantemente ogni giorno, spesso senza rendercene conto. Che cos'è l'Aritmetica Modulare? (La matematica dell'orologio) L'aritmetica modulare è, in parole semplici, la matematica dei resti . Invece di muoverci lungo una retta numerica infinita, lavoriamo all'interno di un sistema ciclico limitato, concentrandoci esclusivamente sul valore...

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,...