PBCS (pbcs v0.1.2) View Source

PKCS #5: Password-Based Cryptography Specification Version 2.0.

See: https://tools.ietf.org/html/rfc2898

Link to this section Summary

Link to this section Types

Specs

cipher_text() :: binary()

Specs

opts() :: Keyword.t()

Specs

plain_text() :: binary()

Specs

protected() :: %{
  alg: String.t(),
  enc: String.t(),
  p2c: pos_integer(),
  p2s: binary()
}

Specs

tag() :: binary()

Link to this section Functions

Specs

decrypt({tag(), cipher_text()}, opts()) ::
  plain_text() | {:error, String.t()} | :error
Link to this function

encrypt(arg, protected, opts)

View Source

Specs

encrypt({tag(), plain_text()}, protected(), opts()) ::
  cipher_text() | {:error, String.t()}