# In RSA encryption, does the value of e need to be random?

I am a novice programmer and am just finishing up an RSA encryption program that I am writing for practice. Currently I have the program generate a relatively small random value for the public key e. When adding the finishing touches, I realized that there was no point for e to be random. Is this thinking correct?

-

## 1 Answer

Yes, this thinking is correct; there is no requirement that the public exponent $e$ to be random. After all, it doesn't matter whether $e$ can be guessed by an attacker; we'll be including that value in the public key anyways.

Common practice is currently to use the fixed value $65537 =2^{16} +1$ for $e$. Any odd value of $e > 1$ will work; however, smaller values of $e$ will tend to make the system brittle against errors in performing the RSA padding.

-

some combinations of $e$ and $n$ don't work.  $e$ and φ(n) must be coprime. – CodesInChaos Dec 4 '12 at 22:23
You could also add that the reason we use values of the form $2^n + 1$ for $e$ is that they have low Hamming weight, which makes modular exponentiation (and thus, encryption) very efficient. – Thomas Dec 5 '12 at 2:52
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9341284036636353, "perplexity_flag": "middle"}