Plug.Crypto.MessageVerifier

MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering.

For example, the cookie store uses this verifier to send data to the client. Although the data can be read by the client, he cannot tamper it.

Summary

secure_compare(left, right)

Compares the two binaries in constant-time to avoid timing attacks

sign(binary, secret)

Signs a binary according to the given secret

verify(binary, secret)

Decodes and verifies the encoded binary was not tampared with

Functions

secure_compare(left, right)

Compares the two binaries in constant-time to avoid timing attacks.

See: http://codahale.com/a-lesson-in-timing-attacks/

sign(binary, secret)

Signs a binary according to the given secret.

verify(binary, secret)

Decodes and verifies the encoded binary was not tampared with.