aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-09 17:50:47 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:26:34 +0200
commit625bd60980741b43344745e7c6a2b8660382e3df (patch)
tree21e73bce9756f2d9e6b0f5e25a6fed232e2f52f1
parenteb715599c9e2e447f649d9fd2dd531820d69400c (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;