1. Technical answer: an RSA public exponent needs to be coprime with the modulus, which is not the same as requiring that it be prime.<p>2. Pragmatic answer: prime numbers are generally coprime with the modulus, and so they&#x27;re an easy answer, and so RSA public exponents tend to be prime.<p>3. Best-practice answer: just use 65537, in all cases. The other popular answer is 3, which is mathematically fine, but leaves less room for implementation error; there are some implementation flaws for which attacks are untenable with e=65537.<p>4. Long-term answer: don&#x27;t use RSA. RSA is well on its way to obsolescence. Most problems you&#x27;d ever want to solve with RSA are better solved with Curve25519 (for DH) and Ed25519 (for signing). Not coincidentally, these are the algorithms implemented by Nacl, the only crypto library you should consider using.<p>5. Scolding answer: if you have to ask, please don&#x27;t try to implement any of this yourself. It is <i>very</i> difficult to get RSA right.