encrypted-message
Safely encrypt & store serializable data using XChaCha20Poly1305.
[dependencies]
encrypted-message = "0.3"
EncryptedMessage
implements FromSql
& ToSql
, allowing you to use EncryptedMessage
as a field type in your models.
diesel
& diesel-mysql
features. Supports the Json
type.diesel
& diesel-postgres
features. Supports the Json
& Jsonb
types.[dependencies]
encrypted-message = { version = "0.3", features = ["diesel", "diesel-<mysql|postgres>"] }
examples/basic.rs
, a basic example of how to use encrypted-message
.examples/config_with_external_data.rs
, an example of a Config
that depends on external data, like a user-provided key or password.This crate uses trusted, pure-Rust encryption using the chacha20poly1305
crate
from the Rust Crypto organization.
Keys are handled safely using the secrecy
crate,
which internally uses the zeroize
crate (also from Rust Crypto)
to zero-out the keys in memory when no longer used.