March 2, 2026
In the Global Financial Markets, the integrity of data is the foundation of all value. Whether we are discussing price discovery on a stock exchange, the allocation of capital, or the verification of a corporate audit, the system fails if the numbers cannot be trusted. If the underlying data is compromised, market efficiency collapses and intrinsic values become meaningless.
In our digital world, this need for integrity extends to every corner of the economy. Whether you are logging into a banking portal, executing a trade on a mobile app, or signing a digital contract, you are relying on "Digital Trust." Every time you hit "Login," you initiate a mathematical exchange that protects your identity and the accuracy of the financial data you rely on.
Now that we have established the importance of data integrity, the question is how you and your bank can talk securely if you have never met in person to exchange a secret password.
The answer is Asymmetric Encryption. Unlike a traditional "shared secret" (like a simple password), this system uses a pair of mathematically linked keys:
This ensures that even if a hacker intercepts your data while it is traveling through a public network, it remains useless to them. They may see the "locked" data, but without the bank’s secret Private Key, it is mathematically impossible to open.
RSA relies on a concept called a One-Way Function. This is something that is very easy to do in one direction but incredibly difficult to undo unless you have a "trapdoor" (special information).
1. Choosing the Prime Numbers Computers pick two massive prime numbers, let's call them $p$ and $q$. These are kept secret.
2. The Multiplication (Easy) The computer multiplies them to get a much larger number, $n$:
$$n = p \times q$$
$n$ becomes part of your Public Key.
3. The Factoring (Hard) Here is the trick: If I give you the number 15, you instantly know the primes are 3 and 5. But if I give you a number that is 600 digits long, even the world's most powerful supercomputers would take billions of years to figure out which two prime numbers were multiplied to create it.
The Secret: Because only you know the original prime numbers ($p$ and $q$), only you can calculate the mathematical "trapdoor" needed to unlock the message.
In real-world finance, we use numbers that are 2,048 bits long. To help you visualize why a hacker cannot simply "guess" these numbers, consider the scale:
The 2,048-Bit RSA Challenge
A 2,048-bit number is approximately 617 decimal digits long. A hacker would need to factor a number of this magnitude:
$$n = p \times q$$
n:
3042855058828907315376914195670980813953070522278164351767253997174644871501805183 6057017731063496025928896581385547777331796803144379451930769130227509465280119154 0051683924225213008505705431755316437789909618350170396824437418754338374889808897 7420761249128561074447871631321552680973978455043528597668396636361337551605453691 3002771943697635236428403661949997563979704206423982991178711280075859177773555912 9140921314551827731471229511133599082557301065522078782433930803475232406664144801 7969145769171154234954397994491751855301516605340056183129514174940847912995526634 2210755118400056012292392258966221023920901
The Secret Prime Factors (p and q): These two numbers are the "Secret Keys." Only the bank knows these. If a hacker finds these, they find the "trapdoor" to the portfolio.
p:
4174497017168498429885484461667813442049923902148506200919928555857680121845295997 3191157954104666745970558650651155129928943106894989053640445721963000587194106944 9848318359274513965595487218554772385691505493393264317124271999777130210009407522 2339062042287010613759079166103039526232551815375157329433408183
q:
17437862882725696102181887368162865858988855566855145710196906754904740216528017159 69952175588914464019101991443172892472332890218047157758198345423885362685650028020 68275617678974723432581894119450590302351723381341065657361632412293085566198692789 949890321050856311480066942013217692419608485955102915546147
This mathematical gap—where locking is instant but unlocking is effectively eternal—is what keeps the global financial system secure.
To explain how RSA works mathematically, we need to look at three specific concepts: Euler’s Totient Theorem, the Totient (Phi) function, and the Modular Multiplicative Inverse.
Euler’s Totient Function ( $\phi$ )
Euler’s totient function ( $\phi(n)$ ) counts the number of natural numbers from 1 to n that are relatively prime to n . We studied how to calculate it in school. It is easier to calculate when n is a prime number.
In RSA, because n is the product of two primes ( $p \times q $), there is a shortcut to find the totient:
$$ \phi(n) = (p - 1)(q - 1) $$
To understand 2,048-bit keys, we can look at the mathematics using small numbers:
Pick primes: ( p = 3, q = 11 )
Compute ( n ):
$$ n = p \times q = 3 \times 11 = 33 $$
$$ \phi(n) = (3 - 1)(11 - 1) = 20 $$
Euler’s theorem is a remarkable rule that combines modular arithmetic and Euler’s totient function.
If a number $m$ is relatively prime to $n$, then:
$$ m^{\phi(n)} \equiv 1 \pmod{n} $$
In other words, if you raise $m$ to the power of $\phi(n)$ and divide by $n$, the remainder is always 1.
Why is this important?
Because it tells us the “magic number of steps” that brings a number back to 1 in modular arithmetic.
Imagine a carousel that takes $\phi(n)$ steps to complete one full rotation. If you start at position $m$ and move forward $\phi(n)$ steps, you return to position 1.
Multiply both sides by $m$:
$$ m \cdot m^{\phi(n)} \equiv m \cdot 1 \pmod{n} $$
Simplify:
$$ m^{\phi(n)+1} \equiv m \pmod{n} $$
You return to your original position $m$. This circular behavior is exactly what makes RSA encryption work.
The core idea of RSA is:
“Twist the message into something complicated, then use Euler’s theorem to bring it back to its original position in one step.”
Let’s break this into the mathematical design process. Before encryption can work, we must create a special pair of numbers $(e, d)$ that guarantees we can return to the original message.
Choose two prime numbers $p$ and $q$, and compute:
$$ \phi(n) = (p - 1)(q - 1) $$
$$ \phi(n) = (3 - 1)(11 - 1) = 20 $$
Select a number $e$ such that:
$$ \gcd(e, \phi(n)) = 1 $$
The greatest common divisor (GCD) being 1 means that $e$ and $\phi(n)$ do not share any common factors other than 1.
In This Example, Let $e = 7$
We must check that $e$ and $\phi(n)$ do not share any common factors except 1.
Suppose from earlier we computed:
$$ \phi(n) = 20 $$
Now compare the factors:
Factors of 7:
1, 7
Factors of 20:
1, 2, 4, 5, 10, 20
The only number they share is 1.
So,
$$ \gcd(7, 20) = 1 $$
because it makes encryption fast while remaining secure.
This is the most important step.
We find $d$ such that:
$$ e \cdot d \equiv 1 \pmod{\phi(n)} $$
This means:
$$ e\cdot d = k\cdot \phi(n) + 1 $$
for some integer $k$.
In words:
When you multiply $e$ and $d$, the result is exactly one more than a multiple of $\phi(n)$.
This guarantees that the exponent $ed$ equals:
$$ e\cdot d = k\cdot\phi(n) + 1 $$
We already know:
$$ \phi(n) = 20 $$
$$ e = 7 $$
Now we must find ( d ) such that:
$$ 7d \equiv 1 \pmod{20} $$
It means:
$$ 7d = 20k + 1 $$
for some integer ( k ).
So we test multiples of 7:
This means we are looking for a number ( d ) such that:
$$ 7d = 20k + 1 $$
Notice:
$$ 21 = 20 + 1 $$
and
$$ 21 = 7 \times 3 $$
So,
$$ 7 \times 3 = 21 \equiv 1 \pmod{20} $$
Therefore,
$$ d = 3 $$
Check:
$$ e\cdot d = 7 \times 3 = 21 = 20 + 1 $$
$$ e \cdot d = \phi(n) + 1 $$
So the condition
$$ e\cdot d = k\cdot\phi(n) + 1 $$
is satisfied.
Public Key (e) = 7
Private Key (d) = 3
RSA is designed so that when we multiply the public key ( e ) and the private key ( d ), the result is exactly 1 more than a multiple of ( $\phi(n)$ ).
To encrypt a message ( m ), we raise it to the power of ( e ):
$$ \text{Ciphertext} = c = m^e \pmod{n} $$
Given:
$$ n = 33, \quad e = 7, \quad d = 3 $$
Choose the message:
$$ m = 2 $$
RSA encryption formula:
$$ c = m^e \pmod{n} $$
Substitute values:
$$ c = 2^7 \pmod{33} $$
Compute:
$$ 2^7 = 128 $$
Reduce modulo 33:
$$ 128 = 33 \times 3 + 29 $$
So,
$$ c = 29 $$
This is public information.
In RSA, the following values are public:
$$ n = 33, \quad e = 7, \quad c = 29 $$
Anyone — including hackers — can see these numbers.
However, they cannot easily compute the private key ( d ) because they would need to know:
$$ \phi(n) $$
“Returning with Euler’s Theorem”
When I receive the ciphertext ( c ), I use my private key ( d ) and compute:
$$ \text{Result} = c^d \pmod{n} $$
Now let’s substitute the mathematics we carefully designed.
Combine the Expressions
Since
$$ c = m^e, $$
$$ c = m^e = 2^7 = 128 $$
we have:
$$ c^d = (m^e)^d = m^{ed} $$
$$ (2^7)^3 = 2^{7 \cdot 3} $$
So,
$$ m^{ed} = 2^{21} $$
Substitute the Designed Exponent
When we created the keys, we ensured:
$$ e \cdot d = k\cdot\phi(n) + 1 $$
$$ 7 \cdot 3 = 1\cdot 20 + 1 $$
Substitute this into the exponent:
$$ m^{ed} = m^{k\phi(n)+1} $$
$$ 2^{7 \cdot 3} = 2^{20+1} $$
Apply Exponent Rules
Using exponent laws:
$$ m^{k\phi(n)+1} = m^{k\phi(n)} \cdot m^1 $$
$$ 2^{21} = 2^{20} \cdot 2 $$
Rewrite:
$$ = \left(m^{\phi(n)}\right)^k \cdot m $$
$$ = \left(2^{20}\right)^1 \cdot 2 $$
The Magic of Euler’s Theorem
Euler’s theorem tells us:
$$ m^{\phi(n)} \equiv 1 \pmod{n} $$
So:
$$ \left(m^{\phi(n)}\right)^k \equiv 1^k \equiv 1 \pmod{n} $$
Therefore:
$$ m^{ed} \equiv 1 \cdot m \equiv m \pmod{n} $$
$$ 2^{21} \equiv 1 \cdot 2 \equiv 2 \pmod{20} $$
Even after going through a complicated exponentiation process,
the result returns exactly to the original message ( m ).
That is the mathematical beauty of RSA.
Even after going through a complicated exponentiation process,
$$ c^d = m^{ed} $$
the result lands exactly back on the original message:
$$ m $$
That is the mathematical beauty of RSA.
To decrypt the message, a hacker would need the private key ( d ).
But how do we compute ( d )?
We must solve:
$$ ed \equiv 1 \pmod{\phi(n)} $$
To solve this equation, we must know:
$$ \phi(n) $$
But to compute ( $\phi(n) $), we must know the two prime numbers that created ( n ):
$$ n = p \times q $$
and
$$ \phi(n) = (p-1)(q-1) $$
If a hacker only knows:
$$ n \quad \text{and} \quad e, $$
they must factor:
$$ n = p \times q $$
to recover ( p ) and ( q ).
For small numbers like 33, this is easy.
But in real RSA:
Let’s return to our original example.
p:
4174497017168498429885484461667813442049923902148506200919928555857680121845295997 3191157954104666745970558650651155129928943106894989053640445721963000587194106944 9848318359274513965595487218554772385691505493393264317124271999777130210009407522 2339062042287010613759079166103039526232551815375157329433408183
q:
17437862882725696102181887368162865858988855566855145710196906754904740216528017159 69952175588914464019101991443172892472332890218047157758198345423885362685650028020 68275617678974723432581894119450590302351723381341065657361632412293085566198692789 949890321050856311480066942013217692419608485955102915546147
We multiply them:
$$ n = p \times q $$
n:
3042855058828907315376914195670980813953070522278164351767253997174644871501805183 6057017731063496025928896581385547777331796803144379451930769130227509465280119154 0051683924225213008505705431755316437789909618350170396824437418754338374889808897 7420761249128561074447871631321552680973978455043528597668396636361337551605453691 3002771943697635236428403661949997563979704206423982991178711280075859177773555912 9140921314551827731471229511133599082557301065522078782433930803475232406664144801 7969145769171154234954397994491751855301516605340056183129514174940847912995526634 2210755118400056012292392258966221023920901
Only ( n ) is public.
The primes ( p ) and ( q ) are secret.
If I only give you:
$$ n $$
Can you recover:
$$ p \quad \text{and} \quad q \quad? $$
To do that, you must factor a number with hundreds of digits.
A 2048-bit number is about:
$$ 2^{2048} $$
possible values.
That is approximately:
$$ 10^{617} $$
different possibilities.
For comparison:
$$ 10^{80} $$
So the number of possible 2048-bit values is astronomically larger than the number of atoms in the entire universe.
Even if you built a machine:
You would still not come close to exhausting the search space.
RSA is secure not because mathematics is mysterious.
It is secure because the numbers involved are so large that breaking them by brute force would require more computational resources than exist in the universe.
RSA is powerful, but it is not the only tool we use.
In real systems, we combine RSA with more advanced symmetric encryption methods, such as: