Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Merge mintkey in #36

Closed
jaekwon opened this issue Sep 12, 2017 · 8 comments
Closed

Merge mintkey in #36

jaekwon opened this issue Sep 12, 2017 · 8 comments

Comments

@jaekwon
Copy link
Contributor

jaekwon commented Sep 12, 2017

We need to use bcrypt for cryptostore.
Lets merge in https://github.com/tendermint/mintkey/blob/master/cmd/mintkey/common.go

@ethanfrey
Copy link
Contributor

This is noted in a comment. I wasn't sure how to set up bcrypt securely, so I left it as a TODO until someone did it wrtie. (Better missing than buggy). Could you make a PR to show me how?

The code to modify is here:
https://github.com/tendermint/go-crypto/blob/master/keys/cryptostore/encoder.go#L23-L26

I guess it should do something like:
https://github.com/tendermint/mintkey/blob/master/cmd/mintkey/common.go#L68-L77

But not sure how to deal with salts and headers. Also, we need to clean up the local file format as per #13 so maybe we should do that to add support for salts.

I don't know the proper design here. Very happy to have someone with more experience in cryptography work on this.

@ethanfrey
Copy link
Contributor

ethanfrey commented Sep 13, 2017

Is bcrypt even the right choice?

Scrypt seems much better against GPU cracking, and is in the go/x/crypto libs:
https://godoc.org/golang.org/x/crypto/scrypt

Or even other algorithms like argon2, the winner of the password hashing competition:
https://news.ycombinator.com/item?id=10863131

Notes on go implementations, which seem not really production-ready:
https://github.com/magical/argon2
golang/go#19896

@adrianbrink
Copy link
Contributor

This is implemented in #38

@adrianbrink
Copy link
Contributor

I think we should stick with the proven crypto, which in this case is bcrypt. It has aged nicely for 14 years without any theoretical vulnerabilities. Scrypt with 3-4 is much less proven. It is more memory heavy and hence better against FPGA cracking.

Some sources:
https://security.stackexchange.com/questions/26245/is-bcrypt-better-than-scrypt#26253

@ethanfrey
Copy link
Contributor

It would be great to make this configurable somehow. At least bcrypt and scrypt. But I think that is related to #13

@adrianbrink
Copy link
Contributor

I'll look into that once I have some time

@zramsay
Copy link
Contributor

zramsay commented Dec 21, 2017

#38

@zramsay zramsay closed this as completed Dec 21, 2017
@ebuchman
Copy link
Contributor

ebuchman commented Dec 30, 2017

configurable kdf is done in #58 via the armor headers. we can add support for scrypt if we like down the road.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants