Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
d130dc24
Commit
d130dc24
authored
8 years ago
by
Tortue95
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into auth_ewif
parents
dbaccc75
0ec5fc58
No related branches found
No related tags found
1 merge request
!45
add Auth Encrypted WIF feature
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/auth.py
+17
-12
17 additions, 12 deletions
src/auth.py
src/silkaj.py
+11
-7
11 additions, 7 deletions
src/silkaj.py
with
28 additions
and
19 deletions
src/auth.py
+
17
−
12
View file @
d130dc24
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
src/silkaj.py
+
11
−
7
View file @
d130dc24
...
...
@@ -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.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment