Modular Arithmetic - RSA Encryption

  • Context: Undergrad 
  • Thread starter Thread starter ice109
  • Start date Start date
  • Tags Tags
    Arithmetic Encryption
Click For Summary

Discussion Overview

The discussion revolves around the mechanics of RSA encryption, specifically focusing on the use of modular arithmetic in the encryption and decryption processes. Participants explore the implications of using modulo n versus modulo t, as well as the computational challenges associated with large numbers in the context of RSA.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions why the encryption and decryption processes are performed modulo n, suggesting it may relate to Euler's theorem.
  • Another participant explains that using modulo n is necessary due to the impracticality of handling extremely large numbers without modular reduction, which can exceed 10^1000 digits.
  • This participant also argues that using modulo t instead of n would compromise the security of the RSA algorithm, as it would allow for the private key to be easily computed from the public key.
  • Concerns are raised about the feasibility of transmitting extremely large numbers, with one participant humorously noting the impracticality of transmitting 10^1237 digits within the lifespan of the solar system.
  • Another participant mentions that Mathematica can handle large exponentiations, indicating that computational tools can manage these calculations, although the context of their use is debated.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and implications of using modulo n versus modulo t, indicating that there is no consensus on the best approach or the reasoning behind the choices made in RSA encryption.

Contextual Notes

Participants highlight the limitations of handling large numbers in RSA encryption and the potential security risks associated with divulging certain values, such as t. The discussion remains open-ended regarding the implications of these choices.

ice109
Messages
1,708
Reaction score
6
I got curious about RSA Encryption after the software signing key for TI-83s got cracked earlier this week and so I'm reading the wiki article about it[RSA]. I'm curious about a step so I'll fill in everyone and then highlight the step I'm not sure about.

Key generation:

1. pick 2 prime numbers p and q

2. compute n = p*q

3. compute the totient t = (p - 1)(q - 1)

4. pick what will be named the exponent e such that 1 < e < t and e and t are coprime

5. pick d such that d*e = 1 ( mod t )

public key is (n,e) private key is (n,d)Encryption:

public key is pre-sent, (n,e). sender uses said public key to compute/send the number/message m like such: c=m^e ( mod n )

Decryption:

m can be recovered as such:

m = c^d = (m^e)^d=m^{1 mod t} = m^{1 + k*t}=m(m^t)^k=m ( mod n)

where the last part is due to euler's theorem about totients.

Fin

the question why everything after key generation is done modulo n? is it to make euler's theorem work out in the end?
 
Physics news on Phys.org
I'm not sure if you're asking (1) why we use modulo n as opposed to not using any modulo at all, or if you're asking (2) why we use modulo n instead of modulo t as per step 5. Anyway I'll answer both.

(1) Ice the numbers in that algorithm can be 4096 binary digits or more, that corresponds to numbers bigger than 10^1000. If you tried to do those exponentiations using the full number (non-modulo) you couldn't even fit the result on the largest hard-drive let alone transmit it before our Sun burns out and our Solar system dies.

(2) Now if perhaps you meant why not use modulo t instead of modulo n? Well this is simple, given t we can easily compute (reverse engineer) the private key from the public key! This is just the algorithm (generalized Euler GCD algorithm) that we use in step 5 for computing d such that de=1 (mod t). It's just as easy (actual identical alorithm) to do this in the other direction (that is to compute e given d and t).

In other words it's absolutely essential that we don’t divulge t or the security of the algorithm is fatally compromised. That's really the interesting part about the RSA "trapdoor". Given (p-1)(q-1) it's trivial to reverse engineer the private key, yet we freely give away pq as part of the public key! At first sight it looks tantalizingly like there might be some easy way to calculate the product (p-1)(q-1) given only the product pq, but in fact there is no known way (other than actually factorising pq to get both p and q first).
 
Last edited:
uart said:
I'm not sure if you're asking (1) why we use modulo n as opposed to not using any modulo at all, or if you're asking (2) why we use modulo n instead of modulo t as per step 5. Anyway I'll answer both.

(1) Ice the numbers in that algorithm can be 4096 binary digits or more, that corresponds to numbers bigger than 10^1000. If you tried to do those exponentiations using the full number (non-modulo) you couldn't even fit the result on the largest hard-drive let alone transmit it before our Sun burns out and our Solar system dies.

(2) Now if perhaps you meant why not use modulo t instead of modulo n? Well this is simple, given t we can easily compute (reverse engineer) the private key from the public key! This is just the algorithm (generalized Euler GCD algorithm) that we use in step 5 for computing d such that de=1 (mod t). It's just as easy (actual identical alorithm) to do this in the other direction (that is to compute e given d and t).


In other words it's absolutely essential that we don’t divulge t or the security of the algorithm is fatally compromised. That's really the interesting part about the RSA "trapdoor". Given (p-1)(q-1) it's trivial to reverse engineer the private key, yet we freely give away pq as part of the public key! At first sight it looks tantalizingly like there might be some easy way to calculate the product (p-1)(q-1) given only the product pq, but in fact there is no known way (other than actually factorising pq to get both p and q first).

mathematica seems to handle the exponentiation just fine:

http://www.wolframalpha.com/input/?i=(2^4096)^(2^4096)


i wasn't asking the second question.
 
Last edited:
ice109 said:
mathematica seems to handle the exponentiation just fine:

http://www.wolframalpha.com/input/?i=(2^4096)^(2^4096)


i wasn't asking the second question.

You want to transmit 10^1237 digits - you have to be kidding right? Even at 100 Gigabit's per second that's still going to take you about 10^1220 years! Our solar system is expected to survive for less than another 10^10 years.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
45
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K