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/jukebox/albumart
|
||||||
www/LOVELand/g1barre/img/qrcodes
|
www/LOVELand/g1barre/img/qrcodes
|
||||||
zen/tools/scraping/transiscope/transiscope.json
|
zen/tools/scraping/transiscope/transiscope.json
|
||||||
|
zen/tools/__pycache__
|
||||||
|
|
Binary file not shown.
|
@ -8,19 +8,19 @@
|
||||||
# protoc --python_out=. crypto.proto
|
# protoc --python_out=. crypto.proto
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
import os
|
import re, base58, base64, crypto_pb2
|
||||||
import base58
|
|
||||||
import base64
|
|
||||||
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
|
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
import crypto_pb2
|
|
||||||
from sys import argv
|
|
||||||
|
|
||||||
# TODO controls
|
# TODO controls
|
||||||
# Capturing keys (from /tmp/secret.dunikey)
|
# 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
|
# Decoding keys
|
||||||
decoded_shared = base58.b58decode(shared_key)
|
decoded_shared = base58.b58decode(shared_key)
|
||||||
|
@ -46,7 +46,7 @@ pkey = crypto_pb2.PrivateKey()
|
||||||
pkey.Type = 1
|
pkey.Type = 1
|
||||||
pkey.Data = ipfs_secure_bytes + ipfs_shared_bytes
|
pkey.Data = ipfs_secure_bytes + ipfs_shared_bytes
|
||||||
PrivKey = base64.b64encode(pkey.SerializeToString()).decode('ascii')
|
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.PeerID="$PeerID"' ~/.ipfs/config
|
||||||
# jq '.Identity.PrivKey="$PrivKey"' ~/.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