No description
Find a file
Blaise 8e4308c0fe
v1.1.0
Update library submodule
Remove shallow designation for newer nim versions

fixes #2
2023-12-28 09:10:37 -06:00
phc-winner-argon2@f57e61e192 v1.1.0 2023-12-28 09:10:37 -06:00
.gitmodules Initial commit. Add submodule, LICENSE, and README 2019-11-12 11:26:56 -06:00
argon2.nim v1.1.0 2023-12-28 09:10:37 -06:00
argon2.nimble v1.1.0 2023-12-28 09:10:37 -06:00
LICENSE Initial commit. Add submodule, LICENSE, and README 2019-11-12 11:26:56 -06:00
README.md Verbiage Changes 2019-11-13 11:29:23 -06:00

Argon2 for nim

A nim wrapper for the Argon2 password hashing library.

Outputs an object that contains the raw and encoded hashes.


Argon2 makes use of multiple threads, so the --threads:on flag must be used when compiling your project.

Use the --recursive flag when cloning manually to pull in the submodule at the same time (nimble does this automatically).

Example usage:

Detailed:

import argon2

var output1 = argon2("i", "password", "somesalt", 2, 65536, 4, 24)
# Argon2 variant, password/data, salt, iterations, memory in Bytes, threads used, hash length

echo output1.raw
echo "---"
echo output1.enc

Output:

@[69, 215, 172, 114, 231, 111, 36, 43, 32, 183, 123, 155, 249, 191, 157, 89, 21, 137, 78, 102, 154, 36, 230, 198]
---
$argon2i$v=19$m=65536,t=2,p=4$c29tZXNhbHQ$RdescudvJCsgt3ub+b+dWRWJTmaaJObG


Simplified:

import argon2

echo argon2("password", "somesalt").enc
# defaults to using Argon2id, 1 iteration, 4096 Bytes memory, 1 thread, 32byte hash length

Output:

$argon2id$v=19$m=4096,t=1,p=1$c29tZXNhbHQ$yIW3jKhc46JgZ3FAcoGEowrd6vyP/WTSy/wUREAmlwc