[openssl-users] RSA Public Key error

prithiraj das prithiraj.das at gmail.com
Wed Dec 12 07:07:11 UTC 2018


I have a RSA public key(PKCS 1v1.5) that I have obtained from somewhere.
That key has been obtained after removing the first 24 bytes from the
originally generated RSA public key. Those 24 bytes are being replaced by
some custom 16 byte information which is being used as some sort of
identifier in some future task and those 16 bytes are playing no role in
encryption. OpenSSL fails to read this key. asn1parse shows some parsing
error and most importantly RSA encryption in OpenSSL using this key fails.
The untampered version of the RSA public key generated from the same source
and containing the original 24 bytes at the beginning of the key is
successfully read by OpenSSL and the RSA encryption using that key is also
successful in OpenSSL. But our requirement is to use the first key
containing the custom 16 byte information.

My understanding is that the first 24 bytes of RSA public key following
PKCS standards doesn't contain the modulus and exponent details required
for RSA encryption.  But OpenSSL seems to require these 24 bytes for
encryption. Can someone please confirm what kind of information is present
in the first 24 bytes of RSA Public key and/or why does OpenSSL need it? If
possible, please suggest a solution to work with that RSA public key
containing custom 16 byte information at the beginning of the key.

Thanks and Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20181212/42da2043/attachment.html>

More information about the openssl-users mailing list