RSA Algorithm in Cryptography [Link]
Home Whiteboard Graphing Calculator Online Compilers Articles Tools
Chapters Categories
Home Cryptography RSA Algorithm in Cryptography
Cryptography RSA Algorithm
RSA (Rivest-Shamir-Adleman) is a famous encryption scheme that makes use of a
combination of public and private keys. This means you have a non-public key and
one that can be shared publicly. Each key can be used to encrypt data, but only the
opposite can be decrypted. RSA was evolved in 1977 via MIT researchers Ron Rivest,
Adi Shamir and Leonard Adleman, whose name bears the set of ruless call.
Despite its popularity as a robust encryption method, RSA's high computing demands
makes it inefficient and resource-intensive. As a result, it may not be the best choice
for encrypting large messages or files because it may drain the system's resources.
1 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
How does RSA work?
RSA is based on the problem of breaking down large numbers into their top factors. To
create an RSA key pair, you need to pick very big prime numbers, p and q. It is crucial
to pick those primes randomly and ensure they are simply unique from each different.
The product of p and q, represented as n, becomes the modulus for the public and
private keys. While n is publicly known, the values of p and q remain confidential.
The carmecheals' totient function of the product of two primes, p and q, is computed.
An integer, e, is chosen as the public exponent. The final step involves calculating d,
which serves as the private exponent.
Let's say we choose p = 61 and q = 53.
n = p * q = 61 * 53 = 3233
(n) = (p-1)(q-1) = 60 * 52 = 3120
Let's choose e = 17 (a common choice).
d = 2753 (computed such that (17 * d) mod 3120 = 1)
So, the public key is (3233, 17), and the private key is (3233, 2753).
To encrypt a message, the sender Uses the public key (n, e) provided by the recipient.
Converts the plaintext message (m) into a ciphertext (c) using the formula −
Suppose we want to encrypt the message "HELLO". We convert it to ASCII: H(72)
E(69) L(76) L(76) O(79).
We will encrypt each ASCII value separately −
H: C = 72^17 mod 3233 = 2103
E: C = 69^17 mod 3233 = 2464
L: C = 76^17 mod 3233 = 2190
L: C = 76^17 mod 3233 = 2190
O: C = 79^17 mod 3233 = 875
2 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
Once the ciphertext (c) is received, the recipient uses their private key (n, d) to
decrypt the message. Computes the plaintext message (m) using the formula −
The recipient receives the ciphertext (2103, 2464, 2190, 2190, 875).
They use their private key to decrypt each value −
M = 2103^2753 mod 3233 = 72 (H)
M = 2464^2753 mod 3233 = 69 (E)
M = 2190^2753 mod 3233 = 76 (L)
M = 2190^2753 mod 3233 = 76 (L)
M = 875^2753 mod 3233 = 79 (O)
So, the decrypted message is "HELLO".
Applications and Use Cases
RSA is used for a variety of information security and cryptography applications. Some
of the most popular applications include −
A digital signature is a technology that allows the recipient of a message to confirm its
authenticity, integrity, and non-repudiation. It verifies that the message was not
altered in transit.
When creating virtual signatures, the sender first generates a hash cost for the
message the usage of a cryptographic hash function. Then you signal it with the help
of running the RSA method with the personal key, which produces the digital signature
as an [Link] recipient can then apply the RSA method to the digital signature
with the sender's public key.
You can also verify the signature by comparing it to the hash value created for the
message.
RSA is commonly used in digital certificates, including SSL certificates. These
3 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
certificates can be used to authenticate the identification of the people or
organizations who run websites.
Digital certificates use RSA to encrypt the certificate issuer's digital signature, which is
then confirmed using his public key. The digital certificate contains information like the
domain name and the organization that owns the website, which helps establish the
website's authenticity to clients.
Another application of RSA is a secure key exchange between two individuals who
have never before shared a secret key. The two parties use the RSA approach to
generate a public-private key pair.
The sender creates a symmetric key, encrypts it using the recipient's public key, and
transmits the encrypted key to the recipient.
The recipient decrypts it with the private key. Both the sender and the recipient share
the same symmetric key, that they can utilize for secure communication.
RSA encrypts messages among two parties throughout a community that is not
always secure, such as the internet. For example, RSA works with Transport Layer
Security (TLS) to installation secure connections among net servers and browsers.
Also, RSA allows secure email communication by enabling message encryption and
decryption.
It is also utilized in Virtual Private Networks (VPNs). VPNs use TLS to enable a
handshake between two parties sharing information. The TLS handshake uses the RSA
method to verify the real identities of both parties who participated in the transaction.
How is RSA secure?
RSA's security relies on the difficulty for computers to find the prime numbers in the
encryption keys. Longer keys increase the difficulty of code-breaking. While 1024-bit
keys were once considered secure, the increasing computing power has led to a shift
towards 2048-bit keys.
Elliptic curve cryptography (ECC), an alternative approach to key generation, offers
faster speeds and reduced battery usage, making it preferred for mobile devices. A
research feat involved creating an RSA key using sound waves, but this method
remains impractical for most hackers. Remember, no matter what, every encryption
method can be hacked it is just a matter of time and effort.
4 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
Advantages of RSA
There are some advantages of Rivest-Shamir-Adleman −
Enhanced Security − RSA encryption eliminates the need for sharing secret
keys, minimizing the risk of unauthorized access.
Verified Communication Authenticity − The interconnectedness of key
pairs ensures only authorized recipients can access messages, preventing
interception.
Efficient Encryption − RSA encryption offers faster encryption compared to
the DSA algorithm, speeding up data transfer.
Data Integrity − Altering data during transmission will disrupt the key usage,
preventing unauthorized decryption. This ensures that tampering is detected
and the receiver is notified.
Summary
RSA, a popular encryption algorithm since 1977, employs public and private key pairs.
While suitable for various tasks, RSA's complexity limits its use for encrypting large
data. Instead, RSA excels in creating digital signatures and certificates, ensuring
secure authentication, communication, and key exchanges. RSA faces potential
vulnerabilities, including unauthorized access, weak key numbers, insecure prime
numbers, fault exploitation, and key theft. To mitigate these risks, implementing the
recommendations provided in the article is crucial when utilizing RSA for cryptographic
applications.
5 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
TOP TUTORIALS
Python Tutorial
Java Tutorial
C++ Tutorial
C Programming Tutorial
C# Tutorial
PHP Tutorial
R Tutorial
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
SQL Tutorial
TRENDING TECHNOLOGIES
Cloud Computing Tutorial
Amazon Web Services Tutorial
Microsoft Azure Tutorial
Git Tutorial
Ethical Hacking Tutorial
Docker Tutorial
Kubernetes Tutorial
DSA Tutorial
Spring Boot Tutorial
SDLC Tutorial
Unix Tutorial
6 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
CERTIFICATIONS
Business Analytics Certification
Java & Spring Boot Advanced Certification
Data Science Advanced Certification
Cloud Computing And DevOps
Advanced Certification In Business Analytics
Artificial Intelligence And Machine Learning
DevOps Certification
Game Development Certification
Front-End Developer Certification
AWS Certification Training
Python Programming Certification
COMPILERS & EDITORS
Online Java Compiler
Online Python Compiler
Online Go Compiler
Online C Compiler
Online C++ Compiler
Online C# Compiler
Online PHP Compiler
Online MATLAB Compiler
Online Bash Terminal
Online SQL Compiler
Online Html Editor
ABOUT US | OUR TEAM | CAREERS | JOBS | CONTACT US | TERMS OF USE |
PRIVACY POLICY | REFUND POLICY | COOKIES POLICY | FAQ'S
7 of 8 16-02-2026, 13:29
RSA Algorithm in Cryptography [Link]
Tutorials Point is a leading Ed Tech company striving to provide the best learning material
on technical and non-technical subjects.
© Copyright 2026. All Rights Reserved.
8 of 8 16-02-2026, 13:29