<p>I did the same exercise on my OSX system, and this is my result:</p>

<pre><code>$ 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
18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725
</code></pre>

<p>I assume that the PEM key is not in correct format, PEM follows some specific rules. There are several discussions also <a href="https://bitcoin.stackexchange.com/questions/41666/pem-format-for-ecdsa">here in bitcoin.SE</a></p>

<p>My privkey.pem looks like this:</p>

<pre><code>$ cat privkey.pem
-----BEGIN EC PRIVATE KEY-----
MFQCAQEEIBjhSntqMH9CapT4EUcB58jndOf5pH4sIDXbKaIGMhcloAcGBSuBBAAK
oSQDIgACUIY61kqHroov6Dwa8ahAPLU/U+SG2FEdrYoEiH5bI1I=
-----END EC PRIVATE KEY-----
</code></pre>

<p>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).</p>

CC BY-SA 4.0
2018-07-28T01:18:33.930Z
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
Pedro Jose Otero Rodriguez
CC BY-SA 4.0
2018-07-27T11:16:45.487Z
2018-07-27T11:16:45.487Z
pebwindkraft
<p>Using OpenSSL ver 1.1.0h on win 8.1 - 32 bit</p>

<p>Im trying to recreate this post using cmd: <a href="https://bitcoin.stackexchange.com/questions/56680/openssl-generate-bitcoin-address">OpenSSL generate Bitcoin address</a></p>

<p>But on step 3:</p>

<pre><code>openssl ec -in c:\keys\private.pem -outform DER|tail -c +8|head -c 32|xxd -p -c 32 &gt; c:\keys\private.key
</code></pre>

<p>I got this error: <code>ec: Unknown cipher c</code></p>

<p>Any idea what im doing going wrong?</p>

CC BY-SA 4.0
2018-07-26T01:13:10.400Z
Try putting `c:\keys\private.pem` in quotes, like `"c:\keys\private.pem"`
Raghav Sood
CC BY-SA 4.0
2018-07-26T01:21:12.647Z
I got the samme error :(
Pedro Jose Otero Rodriguez
CC BY-SA 4.0
2018-07-26T01:22:42.453Z
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
Raghav Sood
CC BY-SA 4.0
2018-07-26T01:38:30.193Z
If it is a locations issue, why steps 1&2 works ok?
Pedro Jose Otero Rodriguez
<address-generation><ecdsa><windows><openssl>
OpenSSL bitcoin addresses generation
Pedro Jose Otero Rodriguez
# OpenSSL bitcoin addresses generation

(Asked by: username_0 on 2018-07-26)

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?

**Tags:** address-generation, ecdsa, windows, openssl

> **Comments:**
> **username_1**: Try putting `c:\keys\private.pem` in quotes, like `"c:\keys\private.pem"`  
> **username_0**: I got the samme error :(  
> **username_1**: 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  
> **username_0**: If it is a locations issue, why steps 1&2 works ok?  

---

## 1 answers

### Answer by username_2 on 2018-07-27. Score: 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
18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725

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
-----BEGIN EC PRIVATE KEY-----
MFQCAQEEIBjhSntqMH9CapT4EUcB58jndOf5pH4sIDXbKaIGMhcloAcGBSuBBAAK
oSQDIgACUIY61kqHroov6Dwa8ahAPLU/U+SG2FEdrYoEiH5bI1I=
-----END EC PRIVATE KEY-----

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).

> **Comments:**
> **username_0**: 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  

---

