Otto v0.1.2 Otto.Cipher behaviour View Source

It is a behaviour for encryption/decryption modules. If you want to write your own cipher module, you should implement this behaviour.

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function

decrypt(ciphertext, iv, tag) View Source
decrypt(nil, iv(), String.t()) :: {:ok, nil}
decrypt(ciphertext(), iv(), String.t()) :: {:ok, plaintext()}

Link to this function

encrypt(plaintext, iv, tag \\ nil) View Source
encrypt(plaintext(), iv(), String.t() | nil) :: {:ok, ciphertext()}

Generate a cipher key for your cipher config.

Link to this section Callbacks

Link to this callback

decrypt(ciphertext, iv, key) View Source
decrypt(ciphertext(), iv(), key()) :: {:ok, plaintext()} | :error

Link to this callback

encrypt(plaintext, iv, key) View Source
encrypt(plaintext(), iv(), key()) :: {:ok, ciphertext()} | :error