4 ms·
One of the big issues with Textook RSA is that it really is what's in most textbooks as being RSA, and then corrected in a later section. For example "Cryptogra
by SAI_Peregrinus 9y ago
One of the big issues with Textook RSA is that it really is what's in most textbooks as being RSA, and then corrected in a later section. For example "Cryptography Engineering" by Schneier, Ferguson, & Tohno does this, introducing RSA without padding in section 12.4 "RSA Defined" and then spends a page or so correcting the issues in section 12.5 "Pitfalls Using RSA. So of course someone going back to the definition when trying to implement something is going to miss the discussion about padding, as it's 5+ pages away!
I feel it would be better to simply define RSA encryption as follows:
First, generate key pairs, exchange public keys, etc.
Then, apply a padding function to your plaintext. The definition of a padding function can be found in section <Section number>.
Then compute c = m^e (mod n).
Send the resulting ciphertext c to the other party.
The padding discussion can still be located outside the definition of the mathematics, but the need to perform the padding is integral to this definition of RSA encryption.
- beagle3 9y agoI disagree. There are many other subtle ways to do things wrong about RSA (and almost any other system); If you can't be bothered to read and comprehend the entire section about RSA implementations before trying to do that, you are going to fail in many other ways as well. For a practitioner's book, it's probably worthwhile to introduce the doom principle[0] early on, and refer to it later in contexts like this one where taking it into account would save your ass. But it's no replacement for reading the entire section about the thing you are implementing. [0] https://web.archive.org/web/20170930085357/https://moxie.org/blog/the-cryptographic-doom-principle https://web.archive.org/web/20170930085357/https://moxie.org... - unfortunately, the link on moxie.org is currently broken.