key-encoder-js icon indicating copy to clipboard operation
key-encoder-js copied to clipboard

How to make raw keys

Open croraf opened this issue 7 years ago • 1 comments

I need to make pem encoded secp256k1 keys.

I do this:

var KeyEncoder = require('key-encoder'),
    keyEncoder = new KeyEncoder('secp256k1')

How I create raw keys from here?

I first have to make these raw keys from here and then encode them in Pem format with keyEncoder.encodePrivate and keyEncoder.encodePublic?

croraf avatar Oct 26 '17 09:10 croraf

In this library, a raw key is a hex string. For secp256k1, you'll see it start with hex bytes 02, 03 or 04 and be either 33 or 65 bytes (66 or 130 hex chars) long. For a description of that curve and an example of a hex point, see: https://en.bitcoin.it/wiki/Secp256k1. For a library that allows you to manipulate points, see: https://github.com/indutny/elliptic

earonesty avatar Aug 09 '18 15:08 earonesty