Using OpenSSL ver 1.1.0h on win 8.1 - 32 bit

Im trying to recreate this post using cmd: OpenSSL generate Bitcoin address

But on step 3:

openssl ec -in c:\keys\private.pem -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > c:\keys\private.key

I got this error: ec: Unknown cipher c

Any idea what im doing going wrong?

  • Try putting c:\keys\private.pem in quotes, like "c:\keys\private.pem" Jul 26, 2018 at 1:13
  • I got the samme error :( Jul 26, 2018 at 1:21
  • I don't have a windows machine on hand, but it's probably just a location issue. Try moving private.pem to the same directory you're running the command from, and using a relative path Jul 26, 2018 at 1:22
  • If it is a locations issue, why steps 1&2 works ok? Jul 26, 2018 at 1:38

1 Answer 1


I did the same exercise on my OSX system, and this is my result:

$ openssl version
OpenSSL 1.0.2j  26 Sep 2016

$ openssl ec -in privkey.pem -outform DER|tail -c +8|head -c 32|xxd -p -c 32
read EC key
writing EC key

I assume that the PEM key is not in correct format, PEM follows some specific rules. There are several discussions also here in bitcoin.SE

My privkey.pem looks like this:

$ cat privkey.pem

This is a "test" key, note the word "Risc" in the generated bitcoin address from this key. Don't use it for any value, the funds will get lost. If you have a test key, and really it is a test key, you can share it, and we can have a look at it (and you will then never ever use it again).

  • I guess is more something about OpenSSL version. Even in the same thread i mention as source, other user comments that with 1.0.2 it is working too. Looks like it is a little bug Jul 28, 2018 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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