The following functions are available globally.
Creates the salted verification key based on a user’s username and password. Only the salt and verification key need to be stored on the server, there’s no need to keep the plain-text password.
Keep the verification key private, as it can be used to brute-force the password from.
public func createSaltedVerificationKey( username: String, password: String, salt: Data? = nil, group: Group = .N2048, algorithm: Digest.Algorithm = .sha1) -> (salt: Data, verificationKey: Data)
(optional) custom salt value; if providing a salt, make sure to provide a good random salt of at least 16 bytes. Default is to generate a salt of 16 bytes.
Groupparameters; default is 2048-bits group.
Digest.Algorithmto use; default is SHA1.
salt (s) and verification key (v)