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

Select scrypt parameter based on computing power and memory #17

Closed
scoddy opened this issue Nov 15, 2014 · 13 comments
Closed

Select scrypt parameter based on computing power and memory #17

scoddy opened this issue Nov 15, 2014 · 13 comments
Assignees

Comments

@scoddy
Copy link
Member

scoddy commented Nov 15, 2014

Users with strong computing power will automatically get higher key derivation standards.

@fd0
Copy link
Member

fd0 commented Nov 16, 2014

Maybe implement an aproach similar to the ruby scrypt gem https://github.com/pbhogan/scrypt or termchalk https://github.com/pquerna/termchalk

@fw42
Copy link
Member

fw42 commented Apr 28, 2015

could use https://github.com/steakknife/scrypt

@fd0
Copy link
Member

fd0 commented Apr 28, 2015

I'd like to not have any C components, if possible. Maybe we can have a look at how the calibration is done, and implement that part ourselves.

FYI: I've also implemented the chunking algorithm in C (see https://github.com/fd0/rabin-cdc), so if performance is limited by the chunker in the future, we'll be able to switch to this implementation.

@andrewchambers
Copy link

I think compression and encryption has more overhead than chunking. But little can be done without allocating all buffers with malloc.

@fd0
Copy link
Member

fd0 commented Jul 3, 2015

Maybe we can collaborate with @elithrar, he also needs this function for the simple-scrypt library at https://github.com/elithrar/simple-scrypt.

@cfcs
Copy link

cfcs commented Jul 3, 2015

There's currently an ongoing standardization project with the intended goal of selecting the "next generation" scrypt replacement.

It should be finished soon (2015 Q2 is now, right?)

https://password-hashing.net/index.html

https://en.wikipedia.org/wiki/Password_Hashing_Competition

Might be worth looking into / waiting for - it seems that libsodium is waiting for the results, too:
http://doc.libsodium.org/password_hashing/index.html

A high-level crypto_pwhash_*() API is intentionally not defined until the Password Hashing Competition is over.

(see also dsheets/ocaml-sodium#16 )

@elithrar
Copy link

elithrar commented Jul 3, 2015

Keep in mind that you may not want to jump on the latest algorithm
immediately. Even with people like Colin Percival & Matthew Green on the
project, allowing some time for the algo and its implementations to be
battle tested.

Anyway, as for scrypt auto-tuning: doing it cross-platform is tricky. The
Ruby stuff does a bogoMIPS based estimation. I haven't invested much of my
free time into it as it's very much a "nice to have".
On Fri, 3 Jul 2015 at 7:13 pm cfcs notifications@github.com wrote:

There's currently an ongoing standardization project with the intended
goal of selecting the "next generation" scrypt replacement.

It should be finished soon (2015 Q2 is now, right?)
https://password-hashing.net/index.html

Might be worth looking into / waiting for.


Reply to this email directly or view it on GitHub
#17 (comment).

@fd0
Copy link
Member

fd0 commented Jul 3, 2015

We'll stick with scrypt() for now, but it'd be nice to do some auto-tuning. It may also be non cross-platform, as we could easily have one implementation per platform. And that could also be used in the simple-scrypt library.

@tgulacsi
Copy link

I have time-limited scrypt hardness autotuner: https://github.com/tgulacsi/go/blob/master/crypthlp/scrypthlp.go

It starts with 14, and increments till the twice of the current run won't finish in the time limit.

Not perfect (first I calculated the optimum based on the time of 14 and that each increment doubles the time, but swapping strikes earlier...), but better than a hard-coded parameter.

@fd0
Copy link
Member

fd0 commented Aug 30, 2015

Oh, thanks for the hint! You've licensed the code as Apache 2.0, do you know whether that's compatible with the BSD license from restic?

@fd0 fd0 closed this as completed Aug 30, 2015
@fd0
Copy link
Member

fd0 commented Aug 30, 2015

Ah, wrong button. :/

@fd0 fd0 reopened this Aug 30, 2015
@tgulacsi
Copy link

As I'm the author, I can (and will) relicense that part with the same license as restic is under, for restic.

That's not too much code, just copy the relevant parts and mention the source and me.

@fd0
Copy link
Member

fd0 commented Aug 30, 2015

Great, I'll have a look!

fd0 added a commit that referenced this issue Aug 21, 2016
@fd0 fd0 closed this as completed in #577 Aug 21, 2016
bmason42 added a commit to NetApp-Polaris/restic that referenced this issue Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants