Time needed to decrypt a message r=p times q, where r is the message.

metal1fc

metal1fc

Answered question

2022-09-04

Time needed to decrypt a message r = p × q, where r is the message.
If we can represent a secret message by a large prime number p, we can transmit over the network the number r = p · q, where q > p is another large prime number that acts as the encryption key and r can take 100 bits.
Question: What is the worst-case time complexity of the above algorithm?
Since the input to the algorithm is just one large number r, assume that the input size n is the number of bytes needed to store r, that is, n = log 2 n 8 , and that each division takes time O(n). So we need r p divisions in order to get the encrypted message. Now the questions is how we can calculate the complexity of the algorithm where we need to guess each and every single possibility, thus I said we need r p divisions.
r p = r 2 100     d i v i s i o n s
Problem: I assume the complexity in the question is referring to number of divisions or both divisions and space? So, the question is now, I am not sure why the complexity is O ( n × 2 4 n )?

Answer & Explanation

Aubrie Conley

Aubrie Conley

Beginner2022-09-05Added 13 answers

Step 1
Guessing each and every probability is not exactly an algorithm, since it doesn’t specify what order we’re guessing in. Nevertheless, the most reasonable interpretation is that we’re using trial division to find p, not q which is the larger divisor of r.
Step 2
The lengt of p is at most half the number of bits of r, which is 4n. So 2 4 n is the order of the maximum value of p.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?