The answer is 6370.
In order for this to work, well, we need a mapping.
We need encryption to be invertible.
Given that the output is mod n,
we have output values that the possible values here
would be from 0 to n - 1.
We need to know that this mapping
maps each message to a unique cipher text, otherwise they wouldn't be invertible.
If 2 messages map to the same value,
then we wouldn't know which to decrypt to.
That would definitely be the case if we have more than the modulus number of values.
That would mean that we've wrapped around and we've definitely used one at least twice.
But as long as m and n are relatively prime,
we should generate all the different values, so we can use each of these as
different messages, but we should be very careful.
What if the value m is 0?
If m is 0 no matter what the exponent is,
we still get 0 as our result.
That's not a very good encryption function if the result doesn't depend on the key.
The same thing if m is 1.
We still get 1 as the output, and in fact,
it's dangerous for any small value to use this encryption.
And one reason you can see that--and we'll talk more about this later--
is the key is public.
We're assuming that the adversary knows e,
so if there's only a small possible set of m values,
the adversary can just try them all and see which one maps,
so it's very dangerous to use a small m as the input message for RSA.
We'll talk more about that later,
but first I want to talk about why RSA is correct
and then why we think it's secure,
at least when it's used in a very careful way.
