Plug.Crypto
Plug.Crypto
Namespace and module for crypto functionality.
Summary
Functions
- mask(left, right)
-
Masks the token on the left with the token on the right
- masked_compare(left, right, mask)
-
Compares the two binaries (one being masked) in constant-time to avoid timing attacks
- safe_binary_to_term(binary)
-
A restricted version a
:erlang.binary_to_term/1
that forbids possibly unsafe terms - secure_compare(left, right)
-
Compares the two binaries in constant-time to avoid timing attacks
Functions
mask(left, right)
Masks the token on the left with the token on the right.
Both tokens are required to have the same size.
masked_compare(left, right, mask)
Compares the two binaries (one being masked) in constant-time to avoid timing attacks.
It is assumed the right token is masked according to the given mask.
safe_binary_to_term(binary)
A restricted version a :erlang.binary_to_term/1
that forbids possibly unsafe terms.
secure_compare(left, right)
Compares the two binaries in constant-time to avoid timing attacks.
See: http://codahale.com/a-lesson-in-timing-attacks/
© 2013 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/plug/Plug.Crypto.html