Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slips
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
slips
Commits
c8ee00e4
Unverified
Commit
c8ee00e4
authored
Apr 20, 2016
by
Pavol Rusnak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup pwdreader for slip-0016
parent
4cb852e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
pwdreader.py
slip-0016/pwdreader.py
+8
-5
No files found.
slip-0016/pwdreader.py
View file @
c8ee00e4
...
...
@@ -33,7 +33,7 @@ def getFileEncKey(key):
filekey
,
enckey
=
key
[:
len
(
key
)
/
2
],
key
[
len
(
key
)
/
2
:]
FILENAME_MESS
=
'5f91add3fa1c3c76e90c90a3bd0999e2bd7833d06a483fe884ee60397aca277a'
digest
=
hmac
.
new
(
filekey
,
FILENAME_MESS
,
hashlib
.
sha256
)
.
hexdigest
()
filename
=
''
.
join
((
digest
,
'.pswd'
))
filename
=
digest
+
'.pswd'
return
[
filename
,
filekey
,
enckey
]
# File level decryption and file reading
...
...
@@ -80,8 +80,11 @@ def getDecryptedNonce(entry):
print
print
'Waiting for TREZOR input ...'
print
title
=
entry
[
'title'
]
.
replace
(
"http://"
,
""
)
.
replace
(
"https://"
,
""
)
ENC_KEY
=
''
.
join
((
'Unlock '
,
title
,
' for user '
,
entry
[
'username'
],
'?'
))
if
'item'
in
entry
:
item
=
entry
[
'item'
]
.
replace
(
'http://'
,
''
)
.
replace
(
'https://'
,
''
)
else
:
item
=
entry
[
'title'
]
.
replace
(
'http://'
,
''
)
.
replace
(
'https://'
,
''
)
ENC_KEY
=
'Unlock
%
s for user
%
s?'
%
(
item
,
entry
[
'username'
])
ENC_VALUE
=
entry
[
'nonce'
]
decrypted_nonce
=
hexlify
(
client
.
decrypt_keyvalue
(
getPath
(),
...
...
@@ -118,13 +121,13 @@ def main():
fileName
=
getFileEncKey
(
masterKey
)[
0
]
#print 'file name:', fileName
path
=
os
.
path
.
expanduser
(
'~/Dropbox/Apps/TREZOR Password
s
/'
)
path
=
os
.
path
.
expanduser
(
'~/Dropbox/Apps/TREZOR Password
Manager
/'
)
#print 'path to file:', path
encKey
=
getFileEncKey
(
masterKey
)[
2
]
#print 'enckey:', encKey
full_path
=
''
.
join
((
path
,
fileName
))
full_path
=
path
+
fileName
parsed_json
=
decryptStorage
(
full_path
,
encKey
)
#list entries
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment