# Create account -\> Generate key pair

**URL:** <https://forum.flow.com/t/create-account-generate-key-pair/2425>\
**Category:** Flow JavaScript SDK\
**Tags:** flow-sdk-js\
**Created:** [September 30, 2021, 1:55am UTC](https://forum.flow.com/t/create-account-generate-key-pair/2425 "2021-09-30T01:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Largos](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@Largos](https://forum.flow.com/u/Largos)\
**Post date:** [September 30, 2021, 1:55am UTC](https://forum.flow.com/t/create-account-generate-key-pair/2425/1 "2021-09-30T01:55:17Z")

</div>

Hi all,

I’m trying to generate a keypair in order to create a flow account.

I’m using [elliptic](https://github.com/indutny/elliptic) library with this code:

const ec = new ec(‘p256’)  
const key = ec.genKeyPair();

the problem is I’m checking the public key in [https://testnet-faucet.onflow.org/](https://testnet-faucet.onflow.org/) trying to create an account but always produce the error “Account creation failed”

A example of public key is:

043e0c532b97cd398577e1795936fe7ef92b9f56a8cd5c0b72e68fd096bd26868c7bcfbd2958c79f06f2fd7e18789018e2ce957e9f5b5bb68c6e1fabc0289976e8

if I generate the public and private key with flocli the process work.

any idea about what is the problem?

best regards

---

<div class="post-metadata">

**Author:** ![bluesign](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bluesign/32/1359_2.png) [@bluesign](https://forum.flow.com/u/bluesign)\
**Post date:** [September 30, 2021, 7:46am UTC](https://forum.flow.com/t/create-account-generate-key-pair/2425/2 "2021-09-30T07:46:38Z")

</div>

remove the leading 04 which means uncompressed key.

3e0c532b97cd398577e1795936fe7ef92b9f56a8cd5c0b72e68fd096bd26868c7bcfbd2958c79f06f2fd7e18789018e2ce957e9f5b5bb68c6e1fabc0289976e8

should work

---

<div class="post-metadata">

**Author:** ![Diego](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Diego](https://forum.flow.com/u/Diego)\
**Post date:** [October 4, 2021, 12:57am UTC](https://forum.flow.com/t/create-account-generate-key-pair/2425/3 "2021-10-04T00:57:25Z")

</div>

Correct, now work it. Thank you very much bluesing,
