0% found this document useful (0 votes)
7 views13 pages

Understanding the RSA Cryptosystem

crypto

Uploaded by

ayhamibdah333
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views13 pages

Understanding the RSA Cryptosystem

crypto

Uploaded by

ayhamibdah333
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RSA CRYPTOSYSTEM

RSA CRYPTOSYSTEM
❑ The most common public-key
algorithm is the RSA cryptosystem,
named for its inventors (Rivest,
Shamir, and Adleman).
RSA CRYPTOSYSTEM
RSA CRYPTOSYSTEM
RSA CRYPTOSYSTEM
RSA CRYPTOSYSTEM
❑ Encryption:
RSA CRYPTOSYSTEM
❑ Decryption:
RSA Example
❑ Bob chooses 7 and 11 as p and q and calculates n = 77. The
value of (n) = (7 − 1)(11 − 1) or 60. Now he chooses two
exponents, e and d, from Z60∗. If he chooses e to be 13, then d
is 37. Note that e × d mod 60 = 1 (they are inverses of each
Now imagine that Alice wants to send the plaintext 5 to Bob.
She uses the public exponent 13 to encrypt 5.

❑ Bob receives the ciphertext 26 and uses the private key 37 to


decipher the ciphertext:
RSA Example 2
❑ Jennifer creates a pair of keys for herself. She chooses p = 397
and q = 401. She calculates n = 159197. She then calculates
(n) = 158400. She then chooses e = 343 and d = 12007. Show
how Ted can send a message to Jennifer if he knows e and n.
❑ Suppose Ted wants to send the message “NO” to Jennifer. He
changes each character to a number (from 00 to 25), with each
character coded as two digits. He then concatenates the two
coded characters and gets a four-digit number. The plaintext is
1314. Figure 10.7 shows the process.
RSA Example 3
❑ Here is a more realistic example. We choose a 512-bit p and
q, calculate n and f(n), then choose e and test for relative
primeness with f(n). We then calculate d. Finally, we show
the results of encryption and decryption. The integer p is a
159-digit number.
RSA Example 3
❑ The modulus n = p × q. It has 309 digits.

❑ f(n) = (p − 1)(q − 1) has 309 digits.


RSA Example 3
❑ Bob chooses e = 35535 (the ideal is 65537) and tests it to
make sure it is relatively prime with f(n). He then finds the
inverse of e modulo f(n) and calls it d.
RSA Example 3
❑ Alice wants to send the message “THIS IS A TEST”, which
can be changed to a numeric value using the 00−26 encoding
scheme (26 is the space character).

❑ The ciphertext calculated by Alice is C = Pe, which is

Common questions

Powered by AI

Ensuring that e is relatively prime to φ(n) is critical because it guarantees the existence of a modular multiplicative inverse of e, which is the private exponent d. This inverse relation allows for the decryption of the ciphertext using the private key. In Example 3, Bob chooses e=35535 and tests it to ensure relative primeness with φ(n); this step is essential to ensure that the encryption and decryption functions can be correctly executed, meaning that the encrypted message can be decrypted back to the original message seamlessly .

In Example 2, Ted encrypts a message for Jennifer by converting the plaintext 'NO' into numeric form using a predefined encoding scheme (e.g., A=00, N=13, O=14) resulting in 1314. He then uses Jennifer's public key, which consists of the modulus n = 159197 and the public exponent e = 343, to encrypt this numeric plaintext. The importance of the public key here is that it allows anyone to encrypt messages for Jennifer securely without knowing her private key, ensuring only Jennifer can decrypt the message using her private key .

To calculate the private key in Bob's example, first, the modulus n is found by multiplying the primes p=7 and q=11, resulting in n=77. The Euler's totient function, φ(n), is calculated as (p-1)(q-1)=6×10=60. Bob chooses a public exponent e from the coprimes of φ(n) and selects e=13. The private key, d, is then calculated as the modular multiplicative inverse of e modulo φ(n), which satisfies the equation e×d ≡ 1 (mod 60). Through calculation, d is found to be 37 .

The examples in the document showcase RSA's scalability by varying key sizes and complexity in calculations. Initial examples use small primes (p=7 and q=11) for educational purposes, demonstrating basic functionality, while larger real-world applications, like the one using 512-bit primes, reveal RSA's capability to scale with security requirements. The increase in modulus size (e.g., resulting in 309-digit n) intensifies the computational needs for both encryption and decryption, indicating RSA handles small to large key sizes effectively, with the primary tradeoff being between computational demand and security strength .

Using different exponents in RSA, such as e=35535 instead of 65537, can impact both the efficiency and security of the encryption process. While both numbers must be chosen to be coprime with φ(n), 65537 is preferred due to its properties that facilitate fast encryption and decryption processing speeds, given its lower Hamming weight (number of 1s in the binary representation). Choosing a larger or different exponent like 35535 may increase computational overhead and possibly reduce resistance to certain attack methodologies if not inherently secure, although it might still satisfy key cryptographic requirements .

The primary method by which the RSA cryptosystem could be compromised is through the factoring of the modulus n back into its prime factors p and q. This is feasible if n is not large enough, as advancements in computational power and algorithm efficiency could allow adversaries to factorize smaller n values. Another potential vulnerability arises if the public exponent e is poorly chosen, leading to common modulus attacks or exposing the private key through predictable patterns. The use of small or weak prime numbers can also enhance vulnerability, making the choice of secure, large primes crucial .

The encoding scheme is significant in RSA encryption as it translates characters into numeric values that the algorithm uses for encryption and decryption processes. This transformation is necessary because RSA operates on numeric values rather than text. The scheme ensures that consistent and reversible mappings (e.g., A=00, B=01) facilitate accurate encryption without data loss. In Ted's example, by encoding 'NO' to 1314 and having a systematic encoding scheme, the integrity and privacy of the message are maintained, enabling RSA to work effectively with any textual data .

The RSA cryptosystem ensures secure communication through the use of a public and private key pair for encryption and decryption. The security of RSA is based on the mathematical principle of the difficulty of factoring large composite numbers into their prime components. The system generates a modulus n from two large prime numbers p and q. The public key comprises this modulus n and an exponent e, while the private key comprises n and an exponent d. The values e and d are chosen such that their product is congruent to 1 modulo the Euler's totient function of n, ensuring they are inverses .

RSA cryptosystem relies heavily on modular arithmetic principles, where operations wrap around a modulus. During encryption, plaintext is raised to the power of the public exponent e and then reduced modulo n, converting it to ciphertext. Decryption involves raising ciphertext to the power of the private exponent d and reducing it modulo n, retrieving the original plaintext. This use of modular arithmetic ensures that despite the transformation into different number spaces during encryption and decryption, the information remains consistent and recoverable, underpinning RSA's security and effectiveness .

RSA encryption can handle varying sizes of plaintext by converting the message into an equivalent numeric value through encoding. In Bob's example, a single character (numeric value 5) is encrypted directly. In contrast, Alice's scenario of encrypting a sentence involves encoding each character according to a predefined scheme and concatenating these numbers to form larger blocks that fit the size limitations set by the modulus n. This ability to encode and format different plaintext sizes allows RSA to encrypt both short and long messages, provided the encoded plaintext is numerically smaller than n .

You might also like