RSA Calculator

Step-by-Step Encryption Tool

About RSA Encryption

Learn about the RSA algorithm, its history, and how it works.

History

RSA (Rivest–Shamir–Adleman) is a public-key cryptosystem that is widely used for secure data transmission. It was publicly described in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT.

The acronym RSA comes from the surnames of its inventors. RSA is one of the first practical public-key cryptosystems and is widely used for secure data transmission.

How It Works

RSA is based on the practical difficulty of factoring the product of two large prime numbers. The security of RSA relies on the fact that finding the prime factors of a large composite number is computationally intensive.

The RSA algorithm involves three steps: key generation, encryption, and decryption.

  • Key Generation: Generate public key (n, e) and private key (n, d)
  • Encryption: Convert message to numbers and encrypt using public key
  • Decryption: Decrypt ciphertext using private key

Security

The security of RSA is based on the mathematical difficulty of factoring large numbers. For real-world applications, key sizes of 2048 bits or larger are recommended.

This calculator uses small prime numbers for educational purposes only. In practice, much larger prime numbers are used to ensure security.

Educational (Small Primes)
1024-bit RSA
2048-bit RSA (Recommended)

Mathematical Foundation

The RSA algorithm is based on several mathematical principles:

  • Euler's Totient Function: φ(n) = (p-1)(q-1)
  • Modular Exponentiation: c = me mod n
  • Modular Multiplicative Inverse: e·d ≡ 1 (mod φ(n))

These principles ensure that encryption and decryption are inverse operations: (me)d ≡ m (mod n)

RSA Key Generation

Generate RSA public and private keys step by step.

RSA Encryption

Encrypt a message using RSA public key step by step.

RSA Decryption

Decrypt a message using RSA private key step by step.

Full RSA Demo

See the entire RSA process (key generation, encryption, and decryption) with small prime numbers.

Leave blank to use default values (p=17, q=11)
Advertisement