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

cmd/clef: encrypt the master seed on disk #17704

Merged
merged 5 commits into from
Oct 9, 2018
Merged

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Sep 19, 2018

This PR replaces #17678. It implements an encrypted storage of the clef master seed, utilizing the keystore encryption format, but wrapping it differently.

Example:

{
  "description": "Clef seed",
  "version": 1,
  "params": {
    "cipher": "aes-128-ctr",
    "ciphertext": "005d8c75461d2166b1d100083608ae043875440b2836d3de7d0a21497bf95704477fa544f1dfdd8ef884555ad9b42c9c3943bec441fbf9dd9a45d8bed0003277c91e550abeca9dd5f81af397f26c7f9d2373dd5b698e82850356cb468d27eff4246505f36dc9bb3c5a5210bd35d9288d253235b023bbf84d28af70f5525fbbdf4a88560a0fde5b6d79e8b63e35dae06886e866fa722940c24b851ca8aaf53ed17b483139f9aa0b4b03a61deb08da3b50227721945a26f94c8217932a83c284b9303672268f2f2746a173358d29e4432d5e7d74cdb6a3391942ee8a43ee7a21ff117092419707fda7c11489a008aa241d2419dd8a035144c047c15b483f09e2e2",
    "cipherparams": {
      "iv": "b749360da122b5aa14017627ebcb774f"
    },
    "kdf": "scrypt",
    "kdfparams": {
      "dklen": 32,
      "n": 262144,
      "p": 1,
      "r": 8,
      "salt": "19e1920866fee950cd9ffed66dfb75540b67e1913885b8e6a2b7e05a87cde8f5"
    },
    "mac": "e236ab4f9b494ca49e4d5862d514160f15463e4c04e8316c2221c2dfadf17ab6"
  }
}

It also fixes some errors with the flags.

EDIT: This is now rebased on top off #17756 , since it uses the same method to get a user password.

@holiman holiman requested a review from karalabe as a code owner September 19, 2018 10:37
@holiman holiman changed the title Encryptseed Clef: Encrypt the master seed on disk Sep 19, 2018
// blob that can be decrypted later on.
func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) {
authArray := []byte(auth)
// Encryptdata encrypts the data given as 'data with the password 'auth'.
Copy link
Member

Choose a reason for hiding this comment

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

I think there is a ' missing after data

@holiman holiman force-pushed the encryptseed branch 2 times, most recently from 44c5b91 to 15364fa Compare September 25, 2018 14:37
@holiman
Copy link
Contributor Author

holiman commented Sep 30, 2018

Now rebased on master, so should be ready to merge since #17756 is already in. This touches the keystore a bit, so please look through that in particular.

@holiman
Copy link
Contributor Author

holiman commented Oct 3, 2018

@fjl Could you check the keystore changes?

@holiman holiman added the clef label Oct 5, 2018
@fjl fjl changed the title Clef: Encrypt the master seed on disk cmd/clef: encrypt the master seed on disk Oct 8, 2018
Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

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

Keystore changes LGTM

@holiman holiman merged commit d5c7a60 into ethereum:master Oct 9, 2018
@karalabe karalabe added this to the 1.8.18 milestone Oct 9, 2018
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 28, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Dec 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 1, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 3, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 4, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 6, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 14, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 16, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 17, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 22, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 22, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 23, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 24, 2025
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.

5 participants