-2
$\begingroup$

RSA public keys seem to begin with 3048024100, why? They also seem to end with 0203010001

$\endgroup$
10
$\begingroup$

Only if they are 512-bit and you are looking at the PKCS1 encoding which uses ASN.1 usually DER. 512-bit RSA is not secure; see numerous existing Qs and inter alia the recent Logjam and FREAK attacks. PKCS1 is not the only encoding, and is rarely used alone, instead usually being embedded in X.509/PKIX SubjectPublicKeyInfo; there are other quite different encodings.

3048 is the tag and length of the SEQUENCE for a 512-bit key. 024100 is the tag length and sign octet of a 512-bit positive integer, which the modulus (N) value for a 512-bit RSA key is. 0203 010101 is the tag length and value of the integer 65537, which is the fourth Fermat prime aka F4, and as a result is frequently used for the RSA public exponent (E).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.