Plug.Crypto.encrypt

You're seeing just the function encrypt, go back to Plug.Crypto module for more information.
Link to this function

encrypt(key_base, secret, token, opts \\ [])

View Source

Encodes, encrypts, and signs data into a token you can send to clients.

Options

  • :key_iterations - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to 1000
  • :key_length - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to 32
  • :key_digest - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to :sha256
  • :signed_at - set the timestamp of the token in seconds. Defaults to System.system_time(:second)
  • :max_age - the default maximum age of the token. Defaults to 86400 seconds (1 day) and it may be overridden on decrypt/4.