RSAEncrypting an empty string and then RSADecrypting it results in an NOE instead of returning an empty string as expected.
The first two examples below work fine, but the decrypt line of the third example raises an NOE. It appears the exception occurs within the RSADecrypt method.
Yes that’s a very good point, it’s probably related to something like that… IMHO an empty string/memoryblock should exist but be empty, so I’d consider that a bug in RSAdecrypt…
FWIW RSAEncrypt does create a full length encrypted data block from an empty string “”, but trying to decrypt it fails with an NOE
Since I control the encrypting side too, I’ve worked around this by storing an empty string as the encrypted value for empty strings and then testing for that case before attempting to decrypt it on the other end.