Ported over Rails' MessageVerifier crypto.

Used by Rails for permanent/signed cookies and to share any kind of shared/signed data.