3 ms·
Any RSA scheme must pad messages, otherwise you can leak huge amounts of information. A high level approximation of what I vaguely recall from back when I work
by olliej 3y ago
Any RSA scheme must pad messages, otherwise you can leak huge amounts of information.
A high level approximation of what I vaguely recall from back when I worked on crypto (non scam money version) you get stuff along the lines of ((p^m1 mod N) * (p^m2 mod N)) mod N being the same as (p^(m1+m2) mod N). The padding also acts as something of a nonce, and prevents you from inferring the length of the message itself (e.g. you want 'no', 'yes', 'of course I still love you despite you losing all our money investing in beanie babies' to be the same length).
Of course all of this seems more relevant for protocols that are optimized to perform small data transfers in the key exchange itself due to the monumentally giant key exchanges RSA needs to achieve the same security as ECC (seriously people just use ECC), but I'm sure some cryptographers who understand math better than I ever will can explain why these problems also apply even if all you're doing is an exchange of truly random AES keys.
- tptacek 3y agoRSA-KEM isn't padded. It fills the whole modulus with random bits, transforms it, and then feeds that to a KDF to generate an encryption key.