OPENSSL-EC(1SSL)
π OPENSSL-EC π
okay so bestie, welcome to openssl-ec β it's the OpenSSL 1SSL crew's dedicated lil corner for EC key processing πΈ. She's iconic, she's specific, and she's here to handle your elliptic curve keys like the main character she is. Grab a strawberry π and let's vibe.
β¨ SYNOPSIS β¨
openssl ec [-help] [-inform DER|PEM|P12] [-outform DER|PEM] [-in
filename|uri] [-passin arg] [-out filename] [-passout arg] [-des]
[-des3] [-idea] [-text] [-noout] [-param_out] [-pubin] [-pubout]
[-conv_form arg] [-param_enc arg] [-no_public] [-check] [-provider name]
[-provider-path path] [-provparam [name:]key=value] [-propquery propq]
π¦ DESCRIPTION π¦
The openssl-ec(1) command processes EC keys, periodt. She can convert them between various forms and print out their components β the whole glow-up package π
.
Real talk though: OpenSSL uses the private key format specified in 'SEC 1: Elliptic Curve Cryptography' (http://www.secg.org/). So if you want to convert an OpenSSL EC private key into the PKCS#8 private key format, you gotta go through the openssl-pkcs8(1) command instead. iykyk π§
π OPTIONS π
-helpβ prints out a usage message. the little "hi, here's how to use me" moment π-inform DER|PEM|P12β the key input format. unspecified by default. seeopenssl-format-options(1)for the deets β¨-outform DER|PEMβ the key output format; default isPEM. again,openssl-format-options(1)has the full story. Private keys are an SEC1 private key or PKCS#8 format. Public keys are a SubjectPublicKeyInfo as specified in IETF RFC 3280. no cap π-in filename|uriβ this is where she reads the key from. If you don't specify it, she takes standard input. And if the key is encrypted, bestie, she's gonna prompt you for a pass phrase π-out filenameβ the output filename to write a key to, or standard output if you don't specify one. Note: if any encryption options are set, a pass phrase will be prompted for. Also please please please don't make the output filename the same as the input filename, that's a recipe for tears π-passin arg,-passout argβ the password source for the input and output file. for more info on the format ofarg, seeopenssl-passphrase-options(1)π-des,-des3,-ideaβ these options encrypt the private key with the DES, triple DES, IDEA or any other cipher supported by OpenSSL before outputting it. A pass phrase is prompted for. If none of these options is specified, the key is written in plain text. The way this works out π«: using this command to read in an encrypted key with no encryption option can be used to remove the pass phrase from a key, or by setting the encryption options it can be used to add or change the pass phrase. Zero judgement, full glow-up.
β οΈ heads up: these options can only be used with PEM format output files. that's the rule, bestie.
-textβ prints out the public, private key components and parameters. show-off behavior, honestly π-nooutβ prevents output of the encoded version of the key. lowkey the polite option.-param_outβ print the elliptic curve parameters π-pubinβ by default a private key is read from the input. With this option a public key is read instead. If the input contains no public key but a private key, its public part is used. resourceful queen β¨-puboutβ by default a private key is output. With this option a public key will be output instead. This option is automatically set if the input is a public key. she just knows π-conv_form argβ specifies how the points on the elliptic curve are converted into octet strings. Possible values are:compressed,uncompressed(the default value) andhybrid. For more information regarding the point conversion forms please read the X9.62 standard π
β οΈ Note: Due to patent issues thecompressedoption is disabled by default for binary curves and can be enabled by defining the preprocessor macroOPENSSL_EC_BIN_PT_COMPat compile time. yeah. patents. we don't make the rules π
-param_enc argβ specifies how the elliptic curve parameters are encoded. Possible values are:named_curve, i.e. the ec parameters are specified by an OID, orexplicitwhere the ec parameters are explicitly given (see RFC 3279 for the definition of the EC parameters structures). The default value isnamed_curve.
β οΈ Note: the implicitlyCA alternative, as specified in RFC 3279, is currently not implemented in OpenSSL. it's giving "not yet, bestie" π
-no_publicβ omits the public key components from the private key output. shy girl behavior π-checkβ checks the consistency of an EC private or public key. she's doing a vibe check, literally β¨-provider name-provider-path path-provparam [name:]key=value-propquery propqβ see "Provider Options" inopenssl(1),provider(7), andproperty(7). options all the way down, iykyk π
okay and one more thing β the openssl-pkey(1) command is capable of performing all the operations this command can, as well as supporting other public key types. so if you want the multitasking version, she's right there π«Ά
πΈ EXAMPLES πΈ
The documentation for the openssl-pkey(1) command contains examples equivalent to the ones listed here. but also here they are, because we love a demo π
To encrypt a private key using triple DES:
openssl ec -in key.pem -des3 -out keyout.pem
To convert a private key from PEM to DER format:
openssl ec -in key.pem -outform DER -out keyout.der
To print out the components of a private key to standard output:
openssl ec -in key.pem -text -noout
To just output the public part of a private key:
openssl ec -in key.pem -pubout -out pubkey.pem
To change the parameters encoding to explicit:
openssl ec -in key.pem -param_enc explicit -out keyout.pem
To change the point conversion form to compressed:
openssl ec -in key.pem -conv_form compressed -out keyout.pem
π SEE ALSO π
openssl(1), openssl-pkey(1), openssl-ecparam(1), openssl-dsa(1), openssl-rsa(1)
π HISTORY π
- The
-conv_formand-no_publicoptions are no longer supported with keys loaded from an engine in OpenSSL 3.0. rip to that era π―οΈ - The
-engineoption was removed in OpenSSL 4.0. gone gone, no takebacks π
β COPYRIGHT β
Copyright 2003-2023 The OpenSSL Project Authors. All Rights Reserved. π
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. legal bestie behavior fr fr πβ¨
and that's the whole page, bestie π¦π slay responsibly β this one's from OpenSSL version 4.0.3, dated 2026-09-29, and she ate, no crumbs, periodt π β¨π
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms