I apologize profusely for knowing nothing about cryptography, please go easy on me!
I'm working on a project where I have a 2048-bit RSA private key and a public certificate generated from the private key. I encrypt secrets at one end-point using the certificate and decrypt them at another end-point using the private key.
On decryptor app startup, the code that parses the private key will throw an exception if the private key is unparseable. Right now the exception message discloses the first 21 bits of the key. My question is whether, and to what extent, this could compromise my secrets' security if the exception message got into a log file and was stolen by a malicious attacker.
Does disclosing the 21-bit prefix effectively reduce my 2048-bit private key to a 2027-bit private key? Or does it actually compromise things worse? Or does it not materially change the difficulty of guessing the full 2048-bit key?
EDIT: My private key is required to be DER-encoded in PKCS#8 format, so we are likely talking about the first 21 bits of a DER-encoded, PKCS#8-formatted, private key.