talira

JOSE (Erlang and Elixir)

JSON Object Signing and Encryption for Erlang and Elixir

open sourceMITfree

jose is a JSON Object Signing and Encryption (JOSE) library for Erlang and Elixir. It signs and verifies JSON Web Signatures, encrypts and decrypts JSON Web Encryption, handles JSON Web Keys and JWTs, and covers the RFC 7515 to 7518 algorithms plus JWK thumbprints and the JWS unencoded payload option. It uses the built-in json module on OTP 27 and later, or jiffy, jsx, Poison, Jason and others before that, and falls back to pure Erlang code for ChaCha20-Poly1305, Curve25519, Curve448 and SHA-3 where native support is missing. The unsecured "none" algorithm is off by default. Andrew Bennett wrote it.

Problems it solves

  • sign and verify JWTs in an Erlang or Elixir app
  • encrypt a payload as JWE from Elixir
  • verify tokens in Elixir while only allowing specific signing algorithms

Features

  • JWS signing and verification
  • JWE encryption and decryption
  • JWK keys and thumbprints
  • JWT verification with an allowed-algorithm list
  • ChaCha20-Poly1305, Curve25519 and Curve448
  • the 'none' algorithm disabled by default

Limitations

  • Its pure Erlang curve modules leak timing information and shouldn't be used with long-lived private keys.1

Alternatives

The same job

These do what JOSE (Erlang and Elixir) does.

  1. Joken JSON Web Token (JWT) library for Elixir
  2. Guardian A token based authentication library for Elixir applications
  3. OAuth2 (Elixir) An Elixir OAuth 2.0 client library

Compare JOSE (Erlang and Elixir) with the top 3