arsd.argon2

My minimal interface to https://github.com/p-h-c/phc-winner-argon2

You must compile and install the C library separately.

Members

Functions

encode
string encode(string password, SecurityParameters params = MediumSecurity)

encode a password for secure storage. verify later with verify

verify
bool verify(string savedPassword, string providedPassword)

Check's a user's provided password against the saved password, and returns true if they matched. Neither string can be empty.

Manifest constants

HighSecurity
enum HighSecurity;
LowSecurity
enum LowSecurity;
MediumSecurity
enum MediumSecurity;

Parameters to the argon2 function. Bigger numbers make it harder to crack, but also take more resources for legitimate users too (e.g. making logins and signups slower and more memory-intensive). Some examples are provided. HighSecurity is about 3/4 second on my computer, MediumSecurity about 1/3 second, LowSecurity about 1/10 second.

Structs

SecurityParameters
struct SecurityParameters

Parameters to the argon2 function. Bigger numbers make it harder to crack, but also take more resources for legitimate users too (e.g. making logins and signups slower and more memory-intensive). Some examples are provided. HighSecurity is about 3/4 second on my computer, MediumSecurity about 1/3 second, LowSecurity about 1/10 second.

Meta

Suggestion Box / Bug Report