Skip to content
Snippets Groups Projects
Commit d130dc24 authored by Tortue95's avatar Tortue95 Committed by GitHub
Browse files

Merge branch 'master' into auth_ewif

parents dbaccc75 0ec5fc58
No related branches found
No related tags found
1 merge request!45add Auth Encrypted WIF feature
......@@ -10,7 +10,7 @@ import os
def auth_method(c):
if c.contains_switches('auth-scrypt'):
return auth_by_scrypt()
return auth_by_scrypt(c)
if c.contains_switches('auth-seed'):
return auth_by_seed()
if c.contains_switches('auth-file'):
......@@ -59,19 +59,24 @@ def auth_by_seed():
return seed
def auth_by_scrypt():
def auth_by_scrypt(c):
salt = input("Please enter your Scrypt Salt (Secret identifier): ")
password = getpass.getpass("Please enter your Scrypt password (masked): ")
scrypt_param = input("Please enter your Scrypt parameters (N,r,p):" +
"default [4096,16,1]: ")
if not scrypt_param:
scrypt_param = "4096,16,1"
scrypt_param_splited = scrypt_param.split(",")
n = int(scrypt_param_splited[0])
r = int(scrypt_param_splited[1])
p = int(scrypt_param_splited[2])
if (n <= 0 or n > 65536 or r <= 0 or r > 512 or p <= 0 or p > 32):
if c.contains_definitions('n') and c.contains_definitions('r') and c.contains_definitions('p'):
n, r, p = c.get_definition('n'), c.get_definition('r'), c.get_definition('p')
if n.isnumeric() and r.isnumeric() and p.isnumeric():
n, r, p = int(n), int(r), int(p)
if n <= 0 or n > 65536 or r <= 0 or r > 512 or p <= 0 or p > 32:
print("Error: the values of Scrypt parameters are not good")
exit(1)
else:
print("one of n, r or p is not a number")
exit(1)
else:
print("Using default values. Scrypt parameters not specified or wrong format")
n, r, p = 4096, 16, 1
print("Scrypt parameters used: N: {0}, r: {1}, p: {2}".format(n, r, p))
return get_seed_from_scrypt(salt, password, n, r, p)
......
......@@ -18,15 +18,19 @@ def usage():
\n - info: Display information about currency \
\n \
\n - amount: Get amount of one account \
\n --pubkey=<pubkey[:checksum]> | --auth-scrypt\
\n --auth-seed | --auth-file | --auth-wif\
\n --pubkey=<pubkey[:checksum]>\
\n --auth-scrypt [script parameters -n <N> -r <r> -p <p>] (default: 4096,16,1)\
\n --auth-seed | --auth-file [--file=<path file>] | --auth-wif\
\n \
\n - transaction: Send transaction\
\n --auth-scrypt | --auth-seed | --auth-file [--file=<path file>] | --auth-wif\
\n - authentication:\
\n --auth-scrypt [script parameters -n <N> -r <r> -p <p>] (default: 4096,16,1)\
\n --auth-seed | --auth-file [--file=<path file>] | --auth-wif\
\n - amount:\
\n --amountDU=<relative value> | --amount=<quantitative value>\
\n [--allSources] \
\n --output=<public key>[:checksum] \
\n [--comment=<comment>] \
\n [--allSources] \
\n [--outputBackChange=<public key[:checksum]>] \
\n [-y | --yes], don't ask for prompt confirmation \
\n \
......@@ -44,8 +48,8 @@ def usage():
\n - argos: display currency information formated for Argos or BitBar\
\n \
\n - generate_auth_file: Generate file to store the seed of the account\
\n --auth-scrypt | --auth-seed | --auth-wif\
\n [--file=<path file>] \
\n --auth-scrypt [script parameters -n <N> -r <r> -p <p>] (default: 4096,16,1)\
\n --auth-seed | --auth-file [--file=<path file>] | --auth-wif\
\n \
\n - id <pubkey> or <identity>: get corresponding identity or pubkey from pubkey or identity.\
\n it could autocomplete the pubkey corresponding to an identity with three or four following characters.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment