web_authn_lite v0.4.0 WebAuthnLite.Challenge

Base64 encoded challenge generator

In order to prevent replay attacks, the challenges MUST contain enough entropy to make guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long.

https://www.w3.org/TR/webauthn/#cryptographic-challenges

Link to this section Summary

Functions

generate base64 URL encoded random bytes string

Link to this section Functions

Link to this function generate_base64_url_encoded_challenge(bytes \\ 16)
generate_base64_url_encoded_challenge(bytes :: integer()) :: String.t()

generate base64 URL encoded random bytes string.

iex> WebAuthnLite.Challenge.generate_base64_url_encoded_challenge() |> Base.url_decode64!(padding: false) |> byte_size() 16

iex> WebAuthnLite.Challenge.generate_base64_url_encoded_challenge(100) |> Base.url_decode64!(padding: false) |> byte_size() 100