Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Next step
Extended Euclidean Algorithm CalculatorChinese Remainder Theorem CalculatorEuler's Totient Function Calculator
More tools
Vigenère Cipher Tool
Home Page > Hash and Checksum

RSA Encryption Step-by-Step Simulator

MiniWebtool’s RSA Encryption Step-by-Step Simulator demonstrates RSA using two supplied primes. Follow public- and private-key generation, modular arithmetic, encryption, and decryption in an educational example rather than a production security workflow.

Need help using this tool? Ask AI

For Gemini, paste the copied question into the chat. You can also copy it below.

View the question

3 free uses dailyNo sign-up requiredInstant Results
RSA Encryption Step-by-Step SimulatorTry it now — free ▼
p = 61, q = 53, e = 17: 42 encrypts to 2,557 and decrypts back to 42

Enter two primes, a public exponent and a message number. The result shows each step of key creation, encryption and decryption.

⚡ Quick Examples

Embed RSA Encryption Step-by-Step Simulator Widget

About RSA Encryption Step-by-Step Simulator

What is RSA Encryption?

RSA (Rivest-Shamir-Adleman) is one of the first public-key cryptosystems, published in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. Unlike symmetric encryption (where the same key encrypts and decrypts), RSA uses a key pair: a public key anyone can use to encrypt data, and a private key only the owner can use to decrypt it.

The mathematical security of RSA rests on the integer factorization problem: multiplying two large primes is trivial, but factoring their product back into primes is computationally infeasible for sufficiently large numbers.

At a Glance

RSA Encryption Step-by-Step Simulator walks through RSA with two primes you supply. It shows key generation, modular arithmetic, encryption and decryption as a teaching example, not as a secure encryption tool.

RSA Encryption Step-by-Step Simulator: features at a glance
FeatureWhat you getGood for
Your own primesEnter primes p and q, such as 61 and 53, and a positive integer message smaller than p × q.Following a textbook RSA example with small numbers
Public exponent eType a value for e, or leave it empty and one is chosen automatically. Common choices named on the page are 3, 17 and 65537.Trying different exponents and seeing which ones work
Key generation stepsShows n = p × q, the totient φ(n) = (p−1)(q−1), and the private exponent d found with the Extended Euclidean Algorithm.Understanding where the public and private keys come from
Encrypt and decryptEnter an integer and use the Encrypt or Decrypt buttons to apply the generated keys to it.Checking that decryption returns the original message
Educational onlySmall primes are used for teaching and can be factored instantly. The page states real RSA needs 2048 to 4096-bit keys.Classroom demonstrations of public-key cryptography

How RSA Key Generation Works

The RSA key generation process involves five fundamental steps:

  • Step 1 – Choose Primes: Select two distinct, large prime numbers p and q. The larger these primes, the more secure the keys.
  • Step 2 – Compute Modulus: Calculate n = p × q. The bit length of n determines the key size (e.g., 2048 bits).
  • Step 3 – Euler's Totient: Compute φ(n) = (p−1)(q−1). This value is critical for selecting e and computing d.
  • Step 4 – Public Exponent: Choose e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1. The standard choice is 65537.
  • Step 5 – Private Exponent: Compute d using the Extended Euclidean Algorithm so that d × e ≡ 1 (mod φ(n)).

The Extended Euclidean Algorithm

Computing the private exponent d requires finding the modular multiplicative inverse of e modulo φ(n). The Extended Euclidean Algorithm efficiently solves this by extending the standard GCD algorithm to also find coefficients x and y such that a·x + b·y = gcd(a, b).

When gcd(e, φ(n)) = 1, the algorithm yields x such that e·x ≡ 1 (mod φ(n)), giving us d = x mod φ(n).

RSA Security Considerations

  • Key Size: Modern RSA uses 2048 or 4096-bit keys. The small primes in this simulator are for educational purposes only and can be factored instantly.
  • Padding Schemes: Real-world RSA implementations use padding (OAEP, PKCS#1) to prevent mathematical attacks on raw RSA.
  • Performance: RSA is much slower than symmetric encryption. In practice, RSA encrypts a random symmetric key, which then encrypts the actual data (hybrid encryption).
  • Quantum Threat: Shor's algorithm on a sufficiently powerful quantum computer could factor large numbers efficiently, threatening RSA. Post-quantum cryptography is being developed as a countermeasure.

Practical Applications of RSA

  • TLS/SSL (HTTPS): RSA is used during the handshake to exchange symmetric session keys securely.
  • Digital Signatures: RSA signs documents by applying the private-key operation to a padded hash, verifiable with the public key.
  • Email Encryption: PGP and S/MIME use RSA for encrypting email communications.
  • SSH Authentication: RSA key pairs provide password-less authentication for remote server access.
  • Code Signing: Software publishers sign executables with RSA to prove authenticity and integrity.

Frequently Asked Questions

What is RSA encryption?
RSA (Rivest-Shamir-Adleman) is an asymmetric encryption algorithm that uses two different keys: a public key for encryption and a private key for decryption. The security relies on the mathematical difficulty of factoring the product n = p×q of two large primes.
How does RSA key generation work?
RSA key generation involves selecting two large prime numbers p and q, computing n = p × q, calculating Euler's totient φ(n) = (p−1)(q−1), choosing a public exponent e coprime to φ(n), and computing the private exponent d as the modular inverse of e mod φ(n).
What is the role of Euler's totient function in RSA?
Euler's totient function φ(n) counts integers from 1 to n that are coprime to n. In RSA, it ensures that the encryption and decryption operations are mathematical inverses, making the e·d ≡ 1 (mod φ(n)) relationship possible.
Why must p and q be different prime numbers?
If p = q, then n = p² and computing p from n is trivial (just take the square root). Using different primes ensures factoring n is computationally infeasible for large numbers.
Is this simulator safe for real encryption?
No. This simulator uses small numbers for educational purposes only. Real RSA requires 2048–4096 bit keys (primes hundreds of digits long). Always use established cryptographic libraries for actual security needs.

Reference this content, page, or tool as:

"RSA Encryption Step-by-Step Simulator" at https://MiniWebtool.com/rsa-encryption-step-by-step-simulator/ from MiniWebtool, https://MiniWebtool.com/

Chat with your favorite AI

For Gemini, paste the copied question into the chat. You can also copy it below.

View the question

Hash and Checksum:

Top & Updated:

Soroban Abacus SimulatorBreak Line by CharactersHomebrew ABV Calculator (Alcohol by Volume)View all →
Home Page > Hash and Checksum > RSA Encryption Step-by-Step Simulator