Use binary representation of salt instead of string when calling argon2-browser, to fix hex or base64 encoded salt values
This commit is contained in:
parent
2a1294f1c0
commit
af5b541a2f
@ -79,7 +79,7 @@ class Argon2 extends Operation {
|
|||||||
"Argon2id": argon2.ArgonType.Argon2id
|
"Argon2id": argon2.ArgonType.Argon2id
|
||||||
};
|
};
|
||||||
|
|
||||||
const salt = Utils.convertToByteString(args[0].string || "", args[0].option),
|
const salt = Utils.convertToByteArray(args[0].string || "", args[0].option),
|
||||||
time = args[1],
|
time = args[1],
|
||||||
mem = args[2],
|
mem = args[2],
|
||||||
parallelism = args[3],
|
parallelism = args[3],
|
||||||
|
|||||||
@ -1146,6 +1146,25 @@ TestRegister.addTests([
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Argon2: Base64 Salt",
|
||||||
|
input: "argon2password",
|
||||||
|
expectedOutput: "$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$s43my9eBljQADuF/LWCG8vGqwAJzOorKQ0Yog8jFvbw",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "Argon2",
|
||||||
|
args: [
|
||||||
|
{"option": "Base64", "string": "c29tZXNhbHQ="},
|
||||||
|
3,
|
||||||
|
4096,
|
||||||
|
1,
|
||||||
|
32,
|
||||||
|
"Argon2i",
|
||||||
|
"Encoded hash"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Argon2 compare",
|
name: "Argon2 compare",
|
||||||
input: "argon2password",
|
input: "argon2password",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user