From 6695e769e1f05441b805eea3c44b8255def442b6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 29 Jul 2024 17:36:03 +0200 Subject: [PATCH] 1433: increase memory size --- .../app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt | 2 +- .../app/ehrenamtskarte/backend/cards/Argon2IdHasherTest.kt | 2 +- docs/CreateKoblenzHash.md | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/main/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt b/backend/src/main/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt index 373063f07..838b5f0b0 100644 --- a/backend/src/main/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt +++ b/backend/src/main/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt @@ -60,7 +60,7 @@ class Argon2IdHasher { .withIterations(2) .withSalt(pepperByteArray) .withParallelism(1) - .withMemoryAsKB(19) + .withMemoryAsKB(19456) .build() val generator = Argon2BytesGenerator() diff --git a/backend/src/test/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasherTest.kt b/backend/src/test/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasherTest.kt index 862d2f91e..58523d319 100644 --- a/backend/src/test/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasherTest.kt +++ b/backend/src/test/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasherTest.kt @@ -17,7 +17,7 @@ internal class Argon2IdHasherTest { assertEquals(Environment.getVariable("KOBLENZ_PEPPER"), "123456789ABC") val hash = Argon2IdHasher.hashKoblenzUserData(KoblenzUser("Karla Koblenz", 12213, "123K")) - val expectedHash = "\$argon2id\$v=19\$m=19,t=2,p=1\$78SNlzz8llqPwetRlp8Lnag/WZGPc5XbimYbShpwVMQ" // This expected output was created with https://argon2.online/ + val expectedHash = "\$argon2id\$v=19\$m=19456,t=2,p=1\$57YPIKvU/XE9h7/JA0tZFT2TzpwBQfYAW6K+ojXBh5w" // This expected output was created with https://argon2.online/ assertEquals(expectedHash, hash) } } diff --git a/docs/CreateKoblenzHash.md b/docs/CreateKoblenzHash.md index 52f679b6c..1941bccca 100644 --- a/docs/CreateKoblenzHash.md +++ b/docs/CreateKoblenzHash.md @@ -43,7 +43,7 @@ Hash with Argon2id with the following parameters: | Version | 19 | | Iterations | 2 | | Parallellism | 1 | -| Memory | 19 | +| Memory | 19456 (19MiB) | | HashLength | 32 | | Salt | Secret Salt will be shared with Koblenz
for the example use `123456789ABC` | @@ -51,8 +51,7 @@ Hash with Argon2id with the following parameters: ### 4. The result... ...for the example data and example salt must be (output in encoded form with salt removed): -`$argon2id$v=19$m=19,t=2,p=1$78SNlzz8llqPwetRlp8Lnag/WZGPc5XbimYbShpwVMQ` - +`$argon2id$v=19$m=19456,t=2,p=1$57YPIKvU/XE9h7/JA0tZFT2TzpwBQfYAW6K+ojXBh5w` ## Additional Information