New answers tagged

-1

Before looking into PEM/ASN.1: EC private key is a prime field element, almost a bignumber. EC public key is a point on the curve, (most likely) encoded as two field elements, either prime-field (that is, modulo another prime) or binary extension field. So you look into curve description for background. Just pick two prime numbers for secp521r1 (from your ...


4

The private key data is encoded in ASN.1, so you need to decode that to get the various fields out. openssl asn1parse can do this, but by default it'll parse the "EC PARAMETERS" section of the file (since that comes before the "EC PRIVATE KEY" section), so you need to strip that off first. You can do that with sed, and then pipe the ...


0

FWIW if using OpenSSL library (which OP implied but didn't exactly state), you can call RSA_public_decrypt with RSA_PKCS1_PADDING to get the T specified in PKCS1, and shown in fgrieu's answer. (Calling this 'decrypt' is semantically wrong but OpenSSL derives from SSLeay which was initially created in the 1990s before the mistake in PKCS1v1 of calling ...


Top 50 recent answers are included