mcrypt v0.1.1 Mcrypt

This is a thin wrapper around libmcrypt.

Please see the linked man page for details on the available ciphers and modes.

Summary

Functions

Wraps libmcrypt's mdecrypt_generic, including setup and teardown of the cipher module

Like decrypt, but raises on error

Wraps libmcrypt's mcrypt_generic, including setup and teardown of the cipher module

Like encrypt, but raises on error

Types

algorithm ::
  :arcfour |
  :blowfish |
  :blowfish_compat |
  :cast_128 |
  :cast_256 |
  :des |
  :enigma |
  :gost |
  :loki97 |
  :rc2 |
  :rijndael_128 |
  :rijndael_192 |
  :rijndael_256 |
  :saferplus |
  :serpent |
  :tripledes |
  :twofish |
  :wake |
  :xtea
mode ::
  :ecb |
  :cbc |
  :cfb |
  :ofb |
  :nofb |
  :ncfb |
  :ctr |
  :stream

Functions

decrypt(ciphertext, algorithm, mode, key, iv)

Specs

decrypt(binary, algorithm, mode, binary, binary) ::
  {:ok, binary} |
  :error

Wraps libmcrypt's mdecrypt_generic, including setup and teardown of the cipher module.

decrypt!(ciphertext, algorithm, mode, key, iv)

Specs

decrypt!(binary, algorithm, mode, binary, binary) ::
  binary |
  no_return

Like decrypt, but raises on error.

encrypt(plaintext, algorithm, mode, key, iv)

Specs

encrypt(binary, algorithm, mode, binary, binary) ::
  {:ok, binary} |
  :error

Wraps libmcrypt's mcrypt_generic, including setup and teardown of the cipher module.

encrypt!(plaintext, algorithm, mode, key, iv)

Specs

encrypt!(binary, algorithm, mode, binary, binary) ::
  binary |
  no_return

Like encrypt, but raises on error.

init()