RSA, as we saw is a really amazing public key cipher that uses only basic number theory in its description.

However, whenever a new cipher appears there will be many people that test its security and whenever possible will try to break it.

So far RSA has not been broken but certain bad things can happen with it if you are not careful. Here are a few things that can go wrong.

1) **Using small primes.**

This one is quite obvious, if the primes used are small enough then a computer will make easy work of factorising .

2) **Using primes that are very close.**

This is quite a serious weakness because it makes a big flaw, even if you do use big enough primes. If are relatively close (I know this is ambiguous but should be well understood) then searching for prime factors in the vicinity of will reveal either of the factors in quite a quick time (depending on how close the factors are).

Alternatively, the methods of Fermat factorisation or more general number sieves can be used here to give a quick result in some cases.

3) **Message is an observable th power.**

Sometimes (especially with very small values of ) it is likely that the ciphertext is the th power of an integer. If this is the case then the plaintext can easily be recovered by taking th roots of the corresponding integer equation.

For example suppose the public key of the person I wish to send to is , for simplicity, and suppose that my plaintext is . I would be sending the ciphertext . But if anyone was to intercept this, they would immediately observe that , as an integer, is a perfect cube already and so could cube root to find the plaintext .

4) **Two people using the same , receiving the same message.**

Suppose Alice and Bob use the same and so have public keys of the form and . If and are coprime then Jane is able to read any message that is sent to both of them.

By number theory, coprime guarantees the existence of integers such that . Jane knows the values of so can use Euclids algorithm to find such .

Then , where are the corresponding intercepted ciphertexts.

Thus Jane can find the plaintext by simply reducing the value of modulo .

5) **Sending the same message to or more people with the same (Hastad’s attack).**

I will demonstrate this when but the exact same method works for any .

Suppose three people have public keys (so the number of people is the greater than or equal to the value of ) and also that the same plaintext is encrypted and sent to them. If Jane intercepts these messages then she can find the plaintext.

She first works out and using Euclids algorithm. If either of these are bigger than then she has found one of the prime factors and so can break the message by the usual way (she is able to find one of the private keys then).

If all three of these results turn out to be then are all coprime to each other.

We now note that the intercepted ciphertexts satisfy:

This is essentially a set of linear congruences that we may solve simultaneously for modulo (by the chinese remainder theorem along with the fact that are coprime).

Suppose the solution is:

where is between and .

Now, by definition, the plaintext is less than all three of , so . Thus we must have that as integers. Since we know , we may simply find its cube root and hence finding the plaintext .

It is easy to see how this idea generalises to the general case mentioned above (where you have users or more with the same , all receiving the same message). It is just a matter of using the chinese remainder theorem.

There are more advanced attacks on RSA based on this idea such as Coppersmith’s attack, but this is not so easy to explain. I shall leave that till another time!

## Leave a Reply