-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,469 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ todo | |
parity | ||
ethstore | ||
core | ||
db.* | ||
db.* | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# account/password | ||
ACCOUNT="0x00a329c0648769A73afAc7F9381E08FB43dBEA72" | ||
PASSWORD="" | ||
|
||
# generate random key id | ||
KEY_ID=`hexdump -n 32 -e '8/4 "%08X" 1 "\n"' /dev/random` | ||
|
||
# sign KEY_ID | ||
KEY_ID_SIGNATURE_REQUEST='{"jsonrpc": "2.0", "method": "secretstore_signRawHash", "params": ["'${ACCOUNT}'", "'${PASSWORD}'", "'${KEY_ID}'"], "id":1 }' | ||
echo $KEY_ID_SIGNATURE_REQUEST | ||
|
||
# generate server key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > keyserver.key 2>nul | ||
printf "PRIVATE KEY: 0x" | ||
cat keyserver.key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' | ||
printf "\n\rPUBLIC KEY: 0x" | ||
cat keyserver.key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' | ||
printf "\n\r" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# /*var Web3 = require('web3'); | ||
# var EC = require('elliptic').ec; | ||
# var BN = require('bn.js'); | ||
# const keccak = require('keccakjs'); | ||
# | ||
# var ec = new EC('secp256k1'); | ||
# var web3 = new Web3(Web3.givenProvider || "http://localhost:8545"); | ||
# web3.eth.personal.sign(0xdeadbeef, "0x33a0B352470124757eab6ADbb7402537f2588b93", "password") | ||
# // .then((signature) => web3.eth.personal.ecRecover("0xdeadbeef", signature)) | ||
# .then((signature) => { | ||
# var r = new BN(signature.substr(2, 64), 16); | ||
# var s = new BN(signature.substr(66, 64), 16); | ||
# var v = new BN(signature.substr(130, 2), 16) - 27; | ||
# console.log(signature); | ||
# console.log(r.toString(16)); | ||
# console.log(s.toString(16)); | ||
# console.log(v.toString(16)); | ||
# | ||
# | ||
# var hash = new keccak(256); | ||
# hash.update('\x19Ethereum Signed Message:\n4') | ||
# //hash.update(new Buffer('42004200', 'hex')) | ||
# hash.update(new Buffer('0xdeadbeef', 'hex')); | ||
# var binHash = hash.digest('hex'); // hex output | ||
# | ||
# var public = ec.recoverPubKey(binHash, { r: r, s: s }, v, 'hex'); | ||
# return "0x" + public.x.toString(16) + public.y.toString(16); | ||
# }) | ||
# .then(console.log);*/ | ||
./ethstore public 31A5A0fef65ad8D3afA8848Da4ff277Fdc663162 password.file --dir poa_integration/db.poa_ss1/keys/POA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Private-Key: (256 bit) | ||
priv: | ||
00:ed:b6:7f:dc:bb:e3:92:79:2f:ba:b3:e1:e7:ac: | ||
8d:78:9e:0e:fa:38:78:f0:0a:8a:b2:05:37:ef:c8: | ||
67:fe:01 | ||
pub: | ||
04:96:14:d5:90:98:66:0c:15:1d:02:da:c6:0a:b3: | ||
16:7d:7a:4c:64:39:1d:71:4a:e1:0f:cc:44:0e:06: | ||
6e:cf:02:46:ab:65:9a:3d:2e:0c:5b:70:c3:1e:a5: | ||
6f:8f:5d:fb:69:fe:0e:6f:04:fb:2b:16:d7:94:ff: | ||
ee:31:24:09:eb | ||
ASN1 OID: secp256k1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
read EC key |
Oops, something went wrong.