# Are there maximal rsa modulus keysize above which security start decreasing?

Is there a rsa modulus size where security starts to decrease or is a larger rsa keysize always better? (of course I’m considering things like performance penalty)

• All things being equal and if all goes well, Increasing key size will improve security , but how the factors are generated matters a lot; size might be considered secondary to avoiding some pitfalls. Best practices for selection $p$ and $q$ are much more complex than outlined, and arguably one needs not check they are not to(o) close together. It is not true that standardized well known implementations are more secure than anything homegrown; this is a confusion between being secure, and being trustable; many non-trustable things are secure. – fgrieu Jan 5 '18 at 10:39