I have an application where I want to encrypt a small (15 octets) plaintext to a ciphertext of the same size. I was trying to do this with a 120-bit modulus and calling RSA_private_encrypt() with RSA_NO_PADDING, but some values of the plaintext cause RSA_R_DATA_TOO_LARGE_FOR_MODULUS.
It does not appear that RSA_eay_private_encrypt() (which is where my encryption is winding up) enforces the requirement in PKCS1, that the length of the plaintext be not more than k-11 octets where k is the length of the modulus. Nor (when padding is RSA_NO_PADDING) does it appear to be trying to enforce the PKCS1 requirements for encryption block formatting, where the block header has a block type octet and padding string.
I can arrange for the plaintext to be a little smaller: 14 octets is definitely doable. (The 15 octet length for the ciphertext I can't exceed.) If I arrange for the plaintext to be a zero followed by 14 octets of data, can I make this work?
TIA * 10E6.