OpenSSL "genpkey ec_paramgen_curve:secp521r1" - EC Long Keys

Q

How to generate a new EC key pair with a longer key size using OpenSSL "genpkey" command?

✍: FYIcenter.com

A

If you need a new EC key pair with a longer key size for testing purpose, you can use the OpenSSL "genpkey" command as shown below:

C:\Users\fyicenter>\local\openssl\openssl

OpenSSL> genpkey -genparam -algorithm ec -out ec_test.prm 
   -pkeyopt ec_paramgen_curve:secp521r1

OpenSSL> genpkey -paramfile ec_test.prm -out ec_test.key

OpenSSL> pkey -in ec_test.key -text -noout
Private-Key: (521 bit)
priv:
    00:da:99:e4:2b:b2:56:26:32:52:b7:ff:ef:e7:7c:
    ad:26:39:92:86:a3:7c:e6:22:42:b6:00:03:4a:04:
    97:8c:cc:92:1c:d9:cc:5d:ea:18:63:55:25:d9:89:
    06:a0:70:71:40:2c:3e:23:d5:9d:0f:f5:f5:de:e7:
    5a:1a:27:56:21:fa
pub:
    04:00:0a:f4:43:d7:a5:ce:9c:9b:dc:57:4c:96:ba:
    90:16:0f:c3:37:08:6c:93:bd:fd:09:f3:e1:27:e4:
    a7:c6:cd:9c:3c:bb:4a:34:b2:8f:af:57:fb:05:13:
...

What this test tells us:

  • OpenSSL allows you to generate longer EC keys.

 

OpenSSL "genpkey" Command for EC Keys

⇒⇒OpenSSL Tutorials

2017-06-28, 606👍, 0💬