Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protected private key & Web3 Secret Storage Definition #614

Merged
merged 13 commits into from
Oct 31, 2019

Conversation

dahlia
Copy link
Contributor

@dahlia dahlia commented Oct 24, 2019

This patch implements #577.

ProtectedPrivateKey protects a PrivateKey with a user input passphrase (i.e., password), and can be stored as a JSON data according to Ethereum's Web3 Secret Storage Definition (so-called “keystore”).

At the moment, it implements only minimum compliance according to the spec, pbkdf2 and aes-128-ctr:

PBKDF2 must be supported by all minimally-compliant implementations, denoted though:

  • kdf: pbkdf2

All minimally-compliant implementations must support the AES-128-CTR algorithm, denoted through:

  • cipher: aes-128-ctr

@dahlia dahlia added this to the 0.7.0 milestone Oct 24, 2019
@dahlia dahlia force-pushed the protected-private-key branch from 9d5d39e to 7ae1f30 Compare October 29, 2019 05:48
@codecov
Copy link

codecov bot commented Oct 29, 2019

Codecov Report

Merging #614 into master will decrease coverage by 2.65%.
The diff coverage is 56.05%.

@@            Coverage Diff             @@
##           master     #614      +/-   ##
==========================================
- Coverage   90.82%   88.17%   -2.66%     
==========================================
  Files         202      217      +15     
  Lines       15815    17152    +1337     
==========================================
+ Hits        14364    15123     +759     
- Misses       1146     1153       +7     
- Partials      305      876     +571
Impacted Files Coverage Δ
Libplanet/Crypto/PrivateKey.cs 86.2% <ø> (ø) ⬆️
Libplanet.Tests/KeyStore/Kdfs/KdfTest.cs 100% <100%> (ø)
Libplanet.Tests/TestUtils.cs 93.54% <100%> (+13.54%) ⬆️
Libplanet/KeyStore/KeyJsonException.cs 100% <100%> (ø)
Libplanet/KeyStore/InvalidKeyJsonException.cs 100% <100%> (ø)
Libplanet/KeyStore/IncorrectPassphraseException.cs 100% <100%> (ø)
Libplanet.Tests/Store/StoreTest.cs 99.06% <100%> (ø) ⬆️
Libplanet/ByteUtil.cs 88.23% <100%> (+0.35%) ⬆️
...t.Tests/KeyStore/MismatchedAddressExceptionTest.cs 100% <100%> (ø)
...Tests/KeyStore/IncorrectPassphraseExceptionTest.cs 100% <100%> (ø)
... and 27 more

@dahlia dahlia force-pushed the protected-private-key branch 2 times, most recently from d944d7f to eed97be Compare October 30, 2019 12:44
@dahlia dahlia changed the title WIP: Protected private key Protected private key & Web3 Secret Storage Definition Oct 30, 2019
@dahlia dahlia marked this pull request as ready for review October 30, 2019 12:55
@dahlia dahlia requested review from longfin, limebell, earlbread, moreal and a team October 30, 2019 12:56
dahlia added a commit to dahlia/libplanet that referenced this pull request Oct 31, 2019
dahlia added a commit to dahlia/libplanet that referenced this pull request Oct 31, 2019
It allocates only once if the source's length is known (i.e., the source
implements ICollection<T>).

planetarium#614 (comment)
dahlia added a commit to dahlia/libplanet that referenced this pull request Oct 31, 2019
@dahlia dahlia force-pushed the protected-private-key branch from eed97be to 67c5050 Compare October 31, 2019 06:40
longfin
longfin previously approved these changes Oct 31, 2019
@dahlia dahlia requested a review from earlbread October 31, 2019 06:43
earlbread
earlbread previously approved these changes Oct 31, 2019
Copy link
Contributor

@earlbread earlbread left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be rebased.

@dahlia dahlia dismissed stale reviews from earlbread and longfin via 512f3c7 October 31, 2019 07:03
@dahlia dahlia force-pushed the protected-private-key branch from 67c5050 to 512f3c7 Compare October 31, 2019 07:03
@dahlia dahlia requested review from longfin and earlbread October 31, 2019 07:03
@dahlia dahlia merged commit 7a719d7 into planetarium:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants