<html>
<head>
<style>
h2 {
color: #FF6384;
padding-left: 250px;
}

h4 {
color: #123456;
margin-top: 10px;
margin-bottom: -0px;
font-size: 24px;
}

.predescription {
color: #4c4d33;
font-size: 18px;
font-style: italic;
padding-left: 0px;
font-weight: bold;

}

div {
border: 2px solid #f1f5f9;
border-radius:5px;
padding: 5px;
margin-bottom: 10px;
}
.description{
font-size: 18px;
font-style: italic;
color: #4c4d33;
padding-left: 0px;

}
</style>
</head>
<body>
<h2>RSA Encryption Algorithm Visualization</h2>
<div>
<h4>🔒 Select two distinct prime numbers, p and q:</h4>→
<sub class='predescription'>
Get special numbers that can only be divided evenly by 1 and themselves.
Pick two different special numbers.
</sub>
<br>
<sub class='description'>Imagine picking two unique and extraordinary friends for a game. These friends, represented by the prime numbers p and q, possess exceptional qualities just like star players in a game. Similar to how these friends stand out from the crowd, prime numbers can only be divided evenly by 1 and themselves. The distinctness of p and q ensures a solid foundation for the RSA encryption algorithm, creating a perfect duo for an extraordinary adventure.</sub>
<br>
</div>

<div>
<h4>✖️ Calculate n by multiplying p and q: n = p * q</h4>→
<sub class='predescription'>
Combine the two special numbers into a larger number.
</sub>
<br>
<sub class='description'>Combining the powers of two extraordinary forces, represented by the prime numbers p and q, is like multiplying the strengths of two special players. Just as their strengths multiply when they join forces, the numbers p and q multiply to form a new and powerful number, n. This multiplication creates a robust and unbreakable lock mechanism that protects your valuable secrets, serving as the cornerstone of the RSA encryption algorithm.</sub>
<br>
</div>

<div>
<h4>⚖️ Calculate Euler's totient function of n: φ(n) = (p-1) * (q-1)</h4>→
<sub class='predescription'>Do a magic trick that counts how many numbers play nicely with the larger number.</sub>
<br>
<sub class='description'>Euler's totient function, represented by φ(n), is like a mysterious magic trick that counts how many numbers form a harmonious relationship with the larger number, n. Just as the special numbers had no common factors with the larger number in the previous step, these numbers also have no common factors. The totient function, like a magician's wand, reveals this hidden count, holding the key to unlocking the secrets of encryption and decryption in the RSA algorithm.</sub><br>
</div>

<div>
<h4>🔑 Select a public exponent e, relatively prime to φ(n)</h4>→
<sub class='predescription'>
Choose a magic number that doesn't have any common factors with the result of the magic trick.
</sub>
<br>
<sub class='description'>Choosing a public exponent, denoted as e, is like finding a special key that unlocks the encryption process. This key, represented by the letter 'e', must be uniquely different from the result obtained in the previous step. Just like a key code completely different from a magic trick result, the public exponent ensures secure encryption by having no common factors with Euler's totient function of n (φ(n)).</sub>
<br>
</div>

<div>
<h4>🔢 Calculate the private exponent d, satisfying (d * e) % φ(n) = 1</h4>→
<sub class='predescription'>
Through some mathematical magic, find a secret number that, when multiplied by the magic number and divided by the result of the magic trick, results in an answer of 1.
</sub>
<br>
<sub class='description'>Calculating the private exponent, represented by d, is like solving a math puzzle to discover the secret number that, when multiplied by the public exponent 'e' and divided by Euler's totient function of n (φ(n)), equals 1. This special number, known only to the owner, unlocks and decrypts messages encrypted using the public key. The relationship between d, e, and φ(n) guarantees the ability to reverse the encryption process and reveal the original message.</sub>
<br>
</div>

<div>
<h4>🌐 Public Key: (e, n)</h4>→
<sub class='predescription'>
The public key is like a toy that everyone can play with. It has two numbers: the magic number and the larger number.
</sub>
<br>
<sub class='description'>The public key, represented as (e, n), is like a toy that can be freely shared among friends. It consists of two numbers: the public exponent, e, and the larger number, n. Just as a toy brings joy to multiple people, the public key enables secure communication between sender and recipient. The magic number, e, serves as the key to unlocking the encryption process, and the larger number, n, forms the foundation of the encryption algorithm.</sub>
<br>
</div>

<div>
<h4>📂 Encryption: To encrypt a message M, compute C = (M^e) % n</h4>→
<sub class='predescription'>
Imagine you have a secret message. Put that message inside a special box, raise it to the power of the magic number, and take the remainder when divided by the larger number. The result is the encrypted message.
</sub>
<br>
<sub class='description'>Encryption is like sealing a secret message inside a special box. To encrypt a message M, we raise it to the power of the public exponent, e, and then take the remainder when divided by the larger number, n. This transformation turns the message into an unreadable form, represented by the ciphertext, C. It's like protecting the secret message with an unbreakable seal, ensuring that only the intended recipient with the private key can unlock and read it.</sub>
<br>
</div>

<div>
<h4>🔓 Decryption: To decrypt the ciphertext C, compute M = (C^d) % n</h4>
<sub class='predescription'>→
If you have the encrypted message and the secret numbers, take the encrypted message, raise it to the power of the secret number, and take the remainder when divided by the larger number. The result will be the original secret message.
</sub>
<br>
<sub class='description'>Decryption is like using a special key to unlock a sealed box and reveal the original secret message. To decrypt the ciphertext C, we raise it to the power of the private exponent, d, and then take the remainder when divided by the larger number, n. This reverse transformation, using the private key associated with the public key used for encryption, turns the ciphertext back into the original message, represented by M. It's like unlocking the sealed box and retrieving the hidden treasure inside. Only the intended recipient with the private key can decrypt and read the message.</sub>
<br>
</div>
</body>
</html>