aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksi Lindeman <dec05eba@protonmail.com>2019-04-09 17:50:47 +0200
committerAleksi Lindeman <dec05eba@protonmail.com>2019-04-09 17:50:50 +0200
commit9fbd841d853e1c6483a93e5c96aa589a26e28998 (patch)
tree55841fd288c809f34ffd0b24315f2ad1e0352c44
parent004cb37fce4621fc8537146d866081c67045bc9b (diff)
Revert back to argon2i
-rw-r--r--README.md2
-rw-r--r--src/PasswordHash.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index dcae648..87936c2 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,8 @@ It is designed to use less bandwidth over speed.
Data is signed using ed25519, encrypted using xchacha20-poly1305 ietf and hashed using Blake2b.
See src/Encryption.cpp, src/Signature.cpp and src/Hash.cpp.
Also check Scheme.md for packet construction.
+## Password
+Data is stored encrypted on disk by using the hash of the user password. The password is hashed using Argon2i.
# Limits
Only 800kb of data can be used for each `add`. You can add more data by using `add` several times.
diff --git a/src/PasswordHash.cpp b/src/PasswordHash.cpp
index b757583..f877d20 100644
--- a/src/PasswordHash.cpp
+++ b/src/PasswordHash.cpp
@@ -14,7 +14,7 @@ namespace odhtdb
result.data = new uint8_t[HASH_PASSWORD_LENGTH];
result.size = HASH_PASSWORD_LENGTH;
- if(argon2d_hash_raw(tCost, mCost, parallelism, plainPassword.data, plainPassword.size, salt.data, salt.size, result.data, HASH_PASSWORD_LENGTH) != ARGON2_OK)
+ if(argon2i_hash_raw(tCost, mCost, parallelism, plainPassword.data, plainPassword.size, salt.data, salt.size, result.data, HASH_PASSWORD_LENGTH) != ARGON2_OK)
throw std::runtime_error("Failed to hash password");
return result;