Skip to main content

Timeline for Wrong size for EC key pair

Current License: CC BY-SA 4.0

13 events
when toggle format what by license comment
Oct 7, 2021 at 7:34 history edited CommunityBot
replaced https://tools.ietf.org/html/rfc with https://www.rfc-editor.org/rfc/rfc
Jul 9, 2020 at 6:54 history edited StackzOfZtuff CC BY-SA 4.0
+ asn1editor screenshots
Jul 9, 2020 at 6:42 history edited StackzOfZtuff CC BY-SA 4.0
+screenshot ASN.1 editor
Jun 30, 2017 at 12:52 comment added StackzOfZtuff @Med: theoretically, yes, since the RFC specifies he pubkey part as optional. But, like Dave said, you have trouble finding software that can handle that customized storage format.
Jun 30, 2017 at 11:40 comment added aagargoura I have other question, I saved my keys using PEM_write_ECPrivateKey() to get the private key stored in the disk! The key contain both private and public.. is there any way to get only the private key stored?
Jun 30, 2017 at 11:37 comment added aagargoura @StackzOfZtuff thank you for the explanation! that was helpful
Jun 29, 2017 at 9:01 comment added StackzOfZtuff @dave_thompson_085 Thanks. 1.: Re OctetString-vs-Int: Yup. Rfc5915 page 2 says that it's an unsigned int represented as octet string. 2.: Re v1.1.0. Thanks. Didn't know that. 3.: Re. removing header-byte: yes, I agree. You then need another mechanism to find out the encoding. (Maybe by length of the bit string.)
Jun 28, 2017 at 1:29 comment added dave_thompson_085 The file here is a privatekey file, not a certificate, and as your decode shows has the private value ($d$) as OCTET STRING not INTEGER. The extra 00 on -text seems to be fixed in 1.1.0. If the publickey is compressed, removing the 02 or 03 prefix makes it impossible to recover the correct value unambiguously; for verify you can try both, but for encrypt (e.g. ECDH, ECIES) there is a 50% chance of getting it wrong and making your data unrecoverable. Removing the 04 from uncompressed makes it unusable with standard software, but if you write all your own software you can make it work.
Jun 27, 2017 at 21:46 history edited StackzOfZtuff CC BY-SA 3.0
added 278 characters in body
Jun 27, 2017 at 21:41 history edited StackzOfZtuff CC BY-SA 3.0
added 278 characters in body
Jun 27, 2017 at 21:30 history edited StackzOfZtuff CC BY-SA 3.0
added 2546 characters in body
Jun 27, 2017 at 21:07 history edited StackzOfZtuff CC BY-SA 3.0
added 289 characters in body
Jun 27, 2017 at 20:58 history answered StackzOfZtuff CC BY-SA 3.0