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

Keychain pass phrase #1135

Open
richardschneider opened this issue Dec 7, 2017 · 10 comments
Open

Keychain pass phrase #1135

richardschneider opened this issue Dec 7, 2017 · 10 comments
Labels
exploration P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@richardschneider
Copy link
Contributor

richardschneider commented Dec 7, 2017

The keychain (#1133) requires a pass phrase to protect the private keys at rest.

Currently it is hard coded, which is not secure.

I suggest we add the --pass ... option to ipfs.

If the 'pass' option is not specified, then all access to the keychain should return the error 'Access to the keychain is not allowed, please use --pass'. This is something like pubsub when --enable-pubsub-experiment is not specified.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 9, 2017

@diasdavid @whyrusleeping any comments?

@whyrusleeping
Copy link
Member

whyrusleeping commented Dec 9, 2017

Hrm... In the past i've made that sort of argument accept a filename. That way you never expose your password to your shell history.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 9, 2017

@whyrusleeping Good point, but storing the password in a file is worse. If an attacker has access to your machine, then she can get your password.

What about if no value to --pass then prompt for it.

@whyrusleeping
Copy link
Member

whyrusleeping commented Dec 9, 2017

I would argue that if the attacker has access to your machine, youre screwed already.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 9, 2017

No, you are not screwed. Because all the IPFS keys are encrypted via the pass phrase. So if we don't store the pass phrase, the attacker has to use brute force.

@whyrusleeping
Copy link
Member

whyrusleeping commented Dec 9, 2017

attach gdb to the process, read memory, ???, profit

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 9, 2017

Good point, the pass phrase should be a buffer and when done with it should be set to some random value.

In C#, this is a SecureString

@whyrusleeping
Copy link
Member

whyrusleeping commented Dec 9, 2017

what i'm saying is that if someone has user level access to your user level process, nothing is safe. Even if we clear the passphrase out from memory they can still inspect the keys themselves. The threat model there is the same

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 9, 2017

They keys are safely encrypted with PKCS #8. So just looking at them will not help.

The only way to decrypt the keys is to produce a stretched password from the pass phrase. And I don't store the pass phrase nor the stretched password.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 10, 2017

@whyrusleeping what about following the openssl conventions for a pass phrase.

richardschneider added a commit that referenced this issue Dec 21, 2017
Allow the pass phrase to specified on the jsipfs command line.
richardschneider added a commit that referenced this issue Dec 22, 2017
Allow the pass phrase to specified on the jsipfs command line.
@daviddias daviddias added status/ready Ready to be worked exploration P2 Medium: Good to have, but can wait until someone steps up labels Jan 25, 2018
richardschneider added a commit that referenced this issue Jan 27, 2018
Allow the pass phrase to specified on the jsipfs command line.
@momack2 momack2 added this to Ready in ipfs/js-ipfs May 10, 2019
@momack2 momack2 added this to Ready in ipfs/js-waffle May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exploration P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
No open projects
Development

No branches or pull requests

3 participants