Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik committed Mar 12, 2018
1 parent a86d6e8 commit c54c495
Show file tree
Hide file tree
Showing 22 changed files with 2,469 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ todo
parity
ethstore
core
db.*
db.*
node_modules
12 changes: 12 additions & 0 deletions complete_ext_gen_doc_key.sh
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
6 changes: 6 additions & 0 deletions generate_key_pair.sh
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"
30 changes: 30 additions & 0 deletions get_public.sh
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
12 changes: 12 additions & 0 deletions keyserver.key
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
1 change: 1 addition & 0 deletions nul
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
read EC key
Loading

0 comments on commit c54c495

Please sign in to comment.