From 01b733a70410ac7878ddb73720f64af9668143a6 Mon Sep 17 00:00:00 2001 From: cathugger Date: Wed, 13 Feb 2019 23:35:36 +0000 Subject: [PATCH] reduce password hash opslimit, tweaks --- common.h | 2 +- main.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common.h b/common.h index 5ab9cdd..21998c7 100644 --- a/common.h +++ b/common.h @@ -17,7 +17,7 @@ #define DETERMINISTIC_LOOP_COUNT 1<<24 // Argon2 hashed passphrase stretching settings -#define PWHASH_OPSLIMIT 256 +#define PWHASH_OPSLIMIT 128 #define PWHASH_MEMLIMIT 64 * 1024 * 1024 #define PWHASH_ALG crypto_pwhash_ALG_ARGON2ID13 diff --git a/main.c b/main.c index 9e0c0bd..83fabcf 100644 --- a/main.c +++ b/main.c @@ -937,11 +937,14 @@ int main(int argc,char **argv) } deterministic = 1; fprintf(stderr, "expanding passphrase..."); fflush(stderr); - if (crypto_pwhash(determseed, sizeof(determseed), phrase, strlen(phrase), salt, + if (crypto_pwhash(determseed, sizeof(determseed), + phrase, strlen(phrase), salt, PWHASH_OPSLIMIT, PWHASH_MEMLIMIT, PWHASH_ALG)) { - fprintf(stderr, "out of memory\n"); + + fprintf(stderr, " out of memory!\n"); + exit(1); } - fprintf(stderr, "ok\n"); + fprintf(stderr, " done.\n"); argv++; } else e_additional();