Merge branch 'master' of https://git.p2p.legal/axiom-team/astroport
This commit is contained in:
commit
0cf78d0700
|
@ -3,3 +3,4 @@ www/LOVELand/jukebox/prefs
|
|||
www/LOVELand/jukebox/albumart
|
||||
www/LOVELand/g1barre/img/qrcodes
|
||||
zen/tools/scraping/transiscope/transiscope.json
|
||||
zen/tools/__pycache__
|
||||
|
|
Binary file not shown.
|
@ -8,19 +8,19 @@
|
|||
# protoc --python_out=. crypto.proto
|
||||
#########################################################################
|
||||
|
||||
import os
|
||||
import base58
|
||||
import base64
|
||||
import re, base58, base64, crypto_pb2
|
||||
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
|
||||
from cryptography.hazmat.primitives import serialization
|
||||
import crypto_pb2
|
||||
from sys import argv
|
||||
|
||||
# TODO controls
|
||||
# Capturing keys (from /tmp/secret.dunikey)
|
||||
shared_key = os.popen('cat /tmp/secret.dunikey | grep pub | cut -d " " -f 2').read()
|
||||
secure_key = os.popen('cat /tmp/secret.dunikey | grep sec | cut -d " " -f 2').read()
|
||||
|
||||
dunikey = "/tmp/secret.dunikey"
|
||||
for line in open(dunikey, "r"):
|
||||
if re.search("pub", line):
|
||||
shared_key = line.replace('\n','').split(': ')[1]
|
||||
elif re.search("sec", line):
|
||||
secure_key = line.replace('\n','').split(': ')[1]
|
||||
|
||||
# Decoding keys
|
||||
decoded_shared = base58.b58decode(shared_key)
|
||||
|
@ -46,7 +46,7 @@ pkey = crypto_pb2.PrivateKey()
|
|||
pkey.Type = 1
|
||||
pkey.Data = ipfs_secure_bytes + ipfs_shared_bytes
|
||||
PrivKey = base64.b64encode(pkey.SerializeToString()).decode('ascii')
|
||||
print('PrivKEY={}'.format(base64.b64encode(pkey.SerializeToString()).decode('ascii')))
|
||||
print('PrivKEY=' + base64.b64encode(pkey.SerializeToString()).decode('ascii'))
|
||||
|
||||
# jq '.Identity.PeerID="$PeerID"' ~/.ipfs/config
|
||||
# jq '.Identity.PrivKey="$PrivKey"' ~/.ipfs/config
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys, base58
|
||||
|
||||
ID = sys.argv[1]
|
||||
hexFmt = base58.b58decode(ID)
|
||||
noTag = hexFmt[6:]
|
||||
b58Key = base58.b58encode(noTag).decode()
|
||||
|
||||
print(b58Key)
|
Loading…
Reference in New Issue