Score:1

For RSA keys, is there any security benefit to having P and Q of different bit counts

cn flag

In some RSA libraries I've encountered, the P bit count is left shifted by some amount and Q bit count right shifted by the same amount. For example, if generating a 2048 bit key, the P bit count would be 1088 and the Q bit count would be 960, so the N bit count would still be the requested 2048, assuming appropriate P and Q values are selected.

I've only seen one comment in code explaining this, and it said the described shifting was done to prevent easy factoring of N. My question is spurred by the fact that OpenSSL, the de-facto standard for key generation, does not do this. When generating a 2048 bit key in OpenSSL, you get a P bit count of 1024 bits and a Q bit count of 1024 bits.

fgrieu avatar
ng flag
This is equivalent to [this question](https://crypto.stackexchange.com/q/35087/555) specialized to base 2. In a nutshell, no. And modern common practice is to have $p$ and $q$ of exactly the same bit size.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.