create account

Several ways to generate and validate your EOS private/public keys offline by rogeryu23

View this thread on: hive.blogpeakd.comecency.com
· @rogeryu23 · (edited)
$17.37
Several ways to generate and validate your EOS private/public keys offline
If you are not as paronoid as I do ;), then don't continue reading the following.

Most of people generate the key through eos.io official site including me for the first time, then I start to worry about that I was using a VPN, even I disconnected network before generating the key on the webpage, I worried that VPN is not secure and also the website does not tell me if the keys are validated (maybe they are already validated I think)

So I decided to find ways to generate these keys myself offline.

I found that EOSIO github already had some tools that can help generate and validate keys.
For 1) and 2) I tested myself on Ubuntu 18.04. Of course, you will need to install nodejs, npm, git, curl etc, I am not gonna cover these in this article

Method 1: Use eosjs-ecc tool from https://github.com/EOSIO/eosjs-ecc
a. The wiki already has the installation steps:
git clone https://github.com/EOSIO/eosjs-ecc.git
cd eosjs-ecc
npm install
npm run build_browser

b. To generate private/public keys, create a html file under eosjs-ecc/dist folder with content
```
<!DOCTYPE html>
<html>
<head>
<script src=eosjs-ecc.js></script>
</head>

<body>
<script>
var ecc = eosjs_ecc
ecc.randomKey().then(privateKey => {
    document.write('Private key:      ')
    document.write(privateKey)
    document.write("<p>")
    document.write('Public key:       ')
    var pubkey = ecc.privateToPublic(privateKey)
    document.write(pubkey)
})

</script>

</body>
</html>
```
and open html file so that I will show a pair of keys

2) To validate private/public keys, create another html file under eosjs-ecc/dist folder with content
```
<!DOCTYPE html>
<html>
<head>
<script src=eosjs-ecc.js></script>
</head>

<body>
<script>
var ecc = eosjs_ecc
var privateKey = 'Your EOS private key' 
var pubKey = ecc.privateToPublic(privateKey)
document.write(pubKey)
document.write("<p>")
document.write(privateKey)
var expected_pub = 'Your EOS public key'
if (pubKey === expected_pub) {
  document.write('<p>match')
} else {
  document.write('<p>not match, expected:')
  document.write(expected_pub)
}
</script>

</body>
</html>
```

Method 2:  Use EOS key utility tool in genesis https://github.com/EOSIO/genesis/tree/master/tools/keys

a) for installation, use method 2 in the wiki not method 1
npm install -g electron-packager
npm run compile

b) to run it, you can go to tools/keys/build/EOSXXXXXXXXX/EOSXXXXXX
XXX is the file name I can't remember but there is an executable file that just run it, it will show an app
Click generator to generate keys
and Click Validator to validate keys


Method 3:  Use scatter
Scatter is a tool that provides a google chrome exention https://scatter-eos.com/
install the extension and then after you create your account in scatter, click settings button on top right
and you can see Key Pairs button, click it and you can generate or validate on the UI, it will even tell you if your public key
or private either is not valid or do not match
![scatter.PNG](https://steemitimages.com/DQmfMo5gGsRZVfWWJNUuoeRzJ1ShHNcaygebshrMyh4CLFE/scatter.PNG)

![scatter1.PNG](https://steemitimages.com/DQmYMpDZm7RRcbxrBKpTjXBjk1Bv5EMGwGacWo6J6xxTs4w/scatter1.PNG)

Given above, what I did was
1) Create a virtual machine using Virtualbox
2) Install Ubuntu 18.04
3) Clone all github source code online and follow the steps to set them up
4) Install scatter
5) Disconnect the network
6) Use the Method 1 to generate private/public key
7) Validate the my private and public key using method 2 and 3 to garantee (so paranoid lol)
👍  , , ,
properties (23)
authorrogeryu23
permlinkseveral-ways-to-generate-and-validate-your-eos-private-public-keys-offline
categoryeos
json_metadata{"tags":["eos"],"image":["https://steemitimages.com/DQmfMo5gGsRZVfWWJNUuoeRzJ1ShHNcaygebshrMyh4CLFE/scatter.PNG","https://steemitimages.com/DQmYMpDZm7RRcbxrBKpTjXBjk1Bv5EMGwGacWo6J6xxTs4w/scatter1.PNG"],"links":["https://github.com/EOSIO/eosjs-ecc","https://github.com/EOSIO/eosjs-ecc.git","https://github.com/EOSIO/genesis/tree/master/tools/keys","https://scatter-eos.com/"],"app":"steemit/0.1","format":"markdown"}
created2018-04-29 17:40:09
last_update2018-04-29 17:43:21
depth0
children3
last_payout2018-05-06 17:40:09
cashout_time1969-12-31 23:59:59
total_payout_value13.280 HBD
curator_payout_value4.089 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,528
author_reputation43,072,184,643
root_title"Several ways to generate and validate your EOS private/public keys offline"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,872,455
net_rshares2,756,619,817,211
author_curate_reward""
vote details (4)
@introduce.bot ·
$0.12
✅  @rogeryu23, congratulations on making your first post! **I gave you a $.05 vote!** <br>Will you give me a follow? I'll follow you back in return!
👍  
properties (23)
authorintroduce.bot
permlinkintroduce-bot-re-rogeryu23several-ways-to-generate-and-validate-your-eos-private-public-keys-offline
categoryeos
json_metadata""
created2018-04-29 17:40:21
last_update2018-04-29 17:40:21
depth1
children0
last_payout2018-05-06 17:40:21
cashout_time1969-12-31 23:59:59
total_payout_value0.088 HBD
curator_payout_value0.027 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length148
author_reputation20,568,707,332,317
root_title"Several ways to generate and validate your EOS private/public keys offline"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,872,496
net_rshares18,811,085,623
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @rogeryu23! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@rogeryu23/birthday1.png</td><td><p>Happy Birthday! - You are on the Steem blockchain for 1 year!<p></td></tr></table>

<sub>_[Click here to view your Board](https://steemitboard.com/@rogeryu23)_</sub>


> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-rogeryu23-20190120t054335000z
categoryeos
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-01-20 05:43:36
last_update2019-01-20 05:43:36
depth1
children0
last_payout2019-01-27 05:43:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length546
author_reputation38,975,615,169,260
root_title"Several ways to generate and validate your EOS private/public keys offline"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,647,713
net_rshares0
@steemitboard ·
Congratulations @rogeryu23! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@rogeryu23/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@rogeryu23) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=rogeryu23)_</sub>


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-rogeryu23-20200120t062632000z
categoryeos
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2020-01-20 06:26:33
last_update2020-01-20 06:26:33
depth1
children0
last_payout2020-01-27 06:26:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length624
author_reputation38,975,615,169,260
root_title"Several ways to generate and validate your EOS private/public keys offline"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,568,109
net_rshares0