Skip to content

Commit 07dccbe

Browse files
committed
Use binary representation of salt instead of string when calling argon2-browser, to fix hex or base64 encoded salt values
1 parent 20a8dac commit 07dccbe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/operations/tests/Hash.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,25 @@ TestRegister.addTests([
11461146
}
11471147
]
11481148
},
1149+
{
1150+
name: "Argon2: Base64 Salt",
1151+
input: "argon2password",
1152+
expectedOutput: "$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$s43my9eBljQADuF/LWCG8vGqwAJzOorKQ0Yog8jFvbw",
1153+
recipeConfig: [
1154+
{
1155+
op: "Argon2",
1156+
args: [
1157+
{"option": "Base64", "string": "c29tZXNhbHQ="},
1158+
3,
1159+
4096,
1160+
1,
1161+
32,
1162+
"Argon2i",
1163+
"Encoded hash"
1164+
]
1165+
}
1166+
]
1167+
},
11491168
{
11501169
name: "Argon2 compare",
11511170
input: "argon2password",

0 commit comments

Comments
 (0)